课程: R for Data Science: Lunch Break Lessons

免费学习该课程!

今天就开通帐号,24,100 门业界名师课程任您挑!

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…

内容