Guest User

Untitled

a guest
May 23rd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. # Export your data.frame to a csv file
  2. write.csv(YourDataFrame, file="Path/To/File.csv", row.names=FALSE)
  3.  
  4. # Read in the lines of the file
  5. fileLinesTemp = readLines("Path/To/File.csv")
  6. # Add a bunch of commas to add columns
  7. fileLinesTemp = gsub(",", ",,,,,,,,,,,,,,,,,,,,,,,,", fileLinesTemp)
  8.  
  9. # Write the new lines back to the file
  10. fileConn = file("Path/To/File.csv")
  11. writeLines(fileLinesTemp, fileConn)
  12. close(fileConn)
Add Comment
Please, Sign In to add comment