Writing to a file
readr
also has functions for writing data back to disk:write_csv()
andwrite_tsv()
.Most important arguments are:
x
(the data frame to save), andfile
(the location to save it).- Also you may specify missing values with
na
or other, and if you want to append to an existing file.
IMPORTANT Note that the variable type information that you just set up is lost when you save to CSV because you’re starting over with reading from a plain text file again.