From the course: R for Data Science: Lunch Break Lessons

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

load and save

load and save

- [Instructor] In some of your programs, you just need a fast and clean way to save an object without going through any sort of translations. And to save data objects, R provides save and load. Let's take a look at how that works. First of all, above in line two, I've created a function called todaysTemperature and then I created a vector called dailyTemperature and into it, I put one instance of today's simulated temperature. In line six, I append another sample of a simulated temperature into dailyTemperature. So now, I would like to save dailyTemperature out just as an object. To do that, I'll use save, parenthesis, and I name the object that I want to save. In this case, dailyTemperature. Then I give it a file name of where I'd like to save it to. I'm going to use .rda as the extension. That stands for R data. That's a convention. You don't have to name it rda, but people will understand what it is if you do so. Now what I can see is at the bottom of the file screen, I have a new…

Contents