I often export data.frame's in R but run into the problem when I try to import them back in, lose all of the formatting into date/numeric/logical/factor values and get it all back as character variables instead. It gets kind of old to have to run a cleaning/formatting script over and over again on the same file so I was wondering if there is a way or a parameter on write.table that allows one to conserve all of this?
Asked
Active
Viewed 1,480 times
4
-
6Save files as R objects (use `save` or `saveRDS`). Text files or CSV files don't have column classes. – Gregor Thomas May 25 '16 at 21:59
2 Answers
4
Use saveRDS
and readRDS
. These will save and load your data frames into exactly the same format.

Mhairi McNeill
- 1,951
- 11
- 20