I have a data frame, the name of which is wrapped in a variable "my_var". What I am trying to do is to assign a new column names for this data.
What I have tried is:
names(get(my_var)) <- c("Fruits", "Sweets")
assign(names(get(my_var)), c("Fruits", "Sweets"))
within (get(my_var), assign(names(get(my_var)), c("Fruits", "Sweets")))
Neither of this works.
Thanks