write variable to file r code example
Example 1: r write to txt
fileConn<-file("output.txt")
writeLines(c("Hello","World"), fileConn)
close(fileConn)
Example 2: write text r
write.csv(my_data, file = "my_data.csv")
write.csv2(my_data, file = "my_data.csv")