-
Book Overview & Buying
-
Table Of Contents
Data Wrangling with R
By :
During data exploration or modeling, it becomes crucial to save our work so we can continue from a certain point without the need to rerun the code all over again. This becomes especially interesting when the dataset you are dealing with is particularly large. Large datasets can take much longer to run some operations, so you want to save your clean data in order to pick up from there the next time you revisit that work.
Saving files in R is simple. The utils library takes care of that. The following code saves the content of the df variable – which is the Monthly Treasury Statement (MTS) pulled from the API – to a CSV file in the same working directory of the script or Rproj file:
# Save a variable to csv write.csv(df, "Monthly_Treasury_Statement.csv", row.names = FALSE)
The row.names parameter is used to omit the index column. You can do the same task using the readr version too, write_csv(df, "file_name.csv").
Furthermore...
Change the font size
Change margin width
Change background colour