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?
Use saveRDS and readRDS. These will save and load your data frames into exactly the same format.
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