Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Export your data.frame to a csv file
- write.csv(YourDataFrame, file="Path/To/File.csv", row.names=FALSE)
- # Read in the lines of the file
- fileLinesTemp = readLines("Path/To/File.csv")
- # Add a bunch of commas to add columns
- fileLinesTemp = gsub(",", ",,,,,,,,,,,,,,,,,,,,,,,,", fileLinesTemp)
- # Write the new lines back to the file
- fileConn = file("Path/To/File.csv")
- writeLines(fileLinesTemp, fileConn)
- close(fileConn)
Add Comment
Please, Sign In to add comment