# Spring Cleaning Data: 6 of 6- Saving the Data

[This article was first published on

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

With all the cleaning done, the only thing left to do is save the data to be analyzed, for future use, and I hope by others. The data I thought would be simple, but there were a few interesting twist, like the Primary Credit*, and using ifelse() to edit the districts.**OutLie..R**, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

I have included the product as well as the R-code in a single file for people to use and learn from. I would like to thanks all those who made comments, I find all of them helpful. Below are the links to the files generated and used in the series, and the r-code used to exporting and reloading the data.

List of files used and their links

Previous Posts (Part 1, Part 2, Part 3, Part 4, Part 5)

- DiscountWindow.R -the code used to download and clean up discount window data
- Districts.csv -the table used in post 5 of 6 to seperate the districts
- DiscountWindow.csv -a csv of the final product
- DiscountWindow.RData -RData of the final cleaned up product

#Export the data, csv and RData setwd("C:/Users Defined/") write.csv(dw, file='DiscountWindow.csv') save(dw, file='DiscountWindow.RData') #note when loading the data the envir= needs to be defined #with larger files the RData is definately the way to go #this file is small enough it does not matter load('DiscountWindow.RData', envir=.GlobalEnv) dw<-read.csv(file.choose(), header=T)

Previous Posts (Part 1, Part 2, Part 3, Part 4, Part 5)

To

**leave a comment**for the author, please follow the link and comment on their blog:**OutLie..R**.R-bloggers.com offers

**daily e-mail updates**about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.