Managing data with R
One of the challenges faced while working with massive datasets involves gathering, preparing, and otherwise managing data from a variety of sources. Although we will cover data preparation, data cleaning, and data management in depth by working on real-world machine learning tasks in later chapters, this section highlights the basic functionality for getting data in and out of R.
Saving, loading, and removing R data structures
When you've spent a lot of time getting a data frame into the desired form, you shouldn't need to recreate your work each time you restart your R session. To save data structures to a file that can be reloaded later or transferred to another system, the save()
function can be used to write one or more R data structures to the location specified by the file parameter. R data files have an .RData
or .rda
extension.
Suppose you had three objects named x
, y
, and z
that you would like to save to a permanent file. These might be vectors...