How to save a data.frame in R?

There are several ways. One way is to use save() to save the exact object. e.g. for data frame foo:


Then load it with:


You could also use write.table() or something like that to save the table in plain text, or dput() to obtain R code to reproduce the table.

Leave a Comment