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.

edit, fix, and dataentry

edit, fix, and dataentry

- [Instructor] Manually editing data objects is a bad idea. Changes you make by hand are not reproducible and someone examining your code is not going to know that those changes have been done. However, there are times when you're going to want to do that and for that purpose, R provides you with four different ways to edit R objects. Let's look at these. The first is called edit and here in line 12, I've setup a line that will allow me to edit the values in ChickWeight. The changes that I make are going to be saved into a vector called Chickens. So let's make an obvious change here. I'm going to change the time to 345 something, and when I quit, you'll see that the object Chicken has been created. So let's go over and look at that object, and if I type in Chickens and hit Return and then scroll up to the top, you'll see that my time is now part of Chickens. If I want to, I can create a list and edit that. So if I use edit as.list(ChickWeight), as I've shown in line 14, what I get is…

Contents