Is there a way in R to simply rename a data frame without first copying an existing data frame, giving it a new name, and then deleting the original?
I understand that the copied data frame does not take additional memory. I'm simply looking to limit the number of objects in my RStudio environment to reduce confusion and potential errors downstream.
For example:
df <- data_frame(a = c(1:5),
b = c(6:10))
I know I can always do this
df2 <- df
# Or this
assign('df2', df)
But in both cases I still need to delete df
, so I would rather do something like this:
df3 <- rename(df2)