I'm attempting to print to file the output of a str_split operation as follows:
s <- t(unlist(str_split("foo_bar_0.5", "_"), use.names = FALSE))
write.csv(s, "test.csv", quote = FALSE, row.names = FALSE, col.names = FALSE)
With the row.names = FALSE argument, I was able to remove the row names. However, this code still writes an extra line with the column names to the file as follows:
V1,V2,V3
foo,bar,0.5
With the following warning:
Warning message:
In write.csv(s, "test.csv", quote = FALSE, :
attempt to set 'col.names' ignored
I want only the second line. Any ideas what I am doing wrong?