r - Write table different directory -
i trying write multiple files in different directory 1 r script contained. if write them in same directory works in different 1 not produce output.. here code
list <- split(dataink, list(dataink$name), drop = true) filenames <- paste("~/dir", names(list), ".dat") filenames <- sapply(filenames,gsub,pattern=" .dat",replacement=".dat") mapply(write.table, list, file = filenames,col.names = false, row.names = false, sep = "\t", quote = false)
many thanks!
i guess filenames not defined.
replace
filenames <- paste("~/dir", names(list), ".dat")
by
filenames <- paste0("~/dir/",names(list), ".dat")
Comments
Post a Comment