I've read a .csv file into R, ran some code to edit it and now want to export this data frame as .csv, to read it in later again or whatsoever.
How can I accomplish this in "clean code"?
write.csv(dataframe,"~/Downloads/filename.csv", row.names = FALSE)
Different computers use different directions for slashes (\or/)and on a mac, I typically have to do the "~/ " at the beginning for windows it is typically "C:"
Assuming your data is called df
write.csv(df, "specify_path_and_file_name.csv")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With