I need to convert a file of .csv format to one of .tab format. How do I go about this in R?
答案 0 :(得分:0)
Copying the correct answer from the comments:
write.table(read.csv("old-file.csv", sep=","), "new-file.tab")
Note that read.csv
and write.csv
are just read.table
and write.table
with different defaults.
Also as mentioned in the comments, you might find read_csv
and write_tsv
from the readr package more pleasant to work with (the built-in R functions can have some surprising behavior).