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 have 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 a data structure to a file that can be reloaded later or transferred to another system, use the save()
function. The save()
function writes one or more R data structures to the location specified by the file
parameter. R data files have an .RData
extension.
Suppose you had three objects named x
, y
, and z
that you would like to save to a permanent file. Regardless of whether...