Hello!
I am fairly new to R.
I'm trying to rename a column by using the dplyr rename() function.
The problem is that the column name has an operator in it. To be more precise, the column name is 'USDNOK = X'.
I am able to resolve it by using:
colnames(df)[3] <- "USDNOK"
My question is:
How can I make the rename() function know that the operator is a part of the column name I'm trying to change? And if it's not possible, how can I use brackets inside a pipe?
like:
df %>%
rename(USDNOK=X = USDNOK)
By the way, I have tried several searches without luck. I guess this is a simple task for the person who is trained in R.
Thank you in advance!