Chris
Chris

Reputation: 95

Where does R store data

I am new to r language. I am not sure if I modify the data (e.g. by adding a column), will the dataset itself be changed forever? I am afraid of changing the raw dataset so every time I do some analysis I tend to assign the data to another name. But I just want to know if this is even necessary.

Upvotes: 3

Views: 1008

Answers (1)

David J. Bosak
David J. Bosak

Reputation: 1624

As mentioned in the comments above, R does not automatically change the data on disk. To change the data on disk, you have to explicitly write the data back out to the same file you got it from. R functions work in memory. So you don't have to worry about messing up the original dataset.

Also note that it doesn't hurt anything to assign your dataset a new name when returning from some manipulation function. Sometimes it is helpful to do this for debugging purposes.

Perhaps you are thinking this way because you have worked with SAS. In SAS, everything you do is immediately written to disk. R is totally different.

Upvotes: 1

Related Questions