export a csv in r code example
Example 1: export csv in r
# to store in the current directory
write.csv(data, "data.csv")
# to store in a separate directory
write.csv(data, "file_path\\data.csv")
Example 2: write to csv in r
write.table(df, file = paste("myName.csv"),sep=",", row.names = FALSE)
# row.names = FALSE removes the index of the rows