In R data frames functions to replace original frame

Viewed 19

In R, each time a data frame is filtered for example are there any changes made to the source data frame? What are best practices for preserving the original data frame?

1 Answers

Okay, so I do not understand exactly what you mean but, if you have a .csv file for example ("example.csv") in your working directory and you create an r-object (example) from it, the original .csv file is maintained intact. The example object however changes whenever you apply functions or filters to it. The easiest way to maintain an original data frame is to apply those functions to a differently named object (i.e. example2)

Related