How can I correctly change column names in an R data frame?

I have a data frame in R called newprice, and I want to assign new names to each column individually. Here’s what it looks like:

newprice Chang. Chang. Chang. 1 100 36 136 2 120 -33 87 3 150 14 164 I’m trying to change column names in R like this:

names(newprice)[1] ← paste(“premium”) names(newprice)[2] ← paste(“change”) names(newprice)[3] ← paste(“newprice”) But I keep getting errors like:

Error: unexpected input in “names(newprice)[1]<-paste(“” I’ve also tried using c(“premium”) instead of paste() with no success. I suspect it might be a syntax issue, but I can’t figure it out.

What’s the correct way to rename columns in an R data frame, and is there any reason paste() would cause this kind of error?