Converting lower case to upper case [closed]

I am trying to convert a column from lower case to upper case, but it is not working.

My code:

#Change all city name in city to uppercase.
library(magrittr)
city %>% colnames<-(tolower(names(name))) %>% head


I do not understand your question completely, however if you are trying to convert text to upper case you should not use the tolower() function rather you should use the toupper() function.

For example:

toupper("A")


and if you want to make the column names uppercase I guess the syntax would be:

toupper(colnames(dataframe))

• Yea I have a cab file named city. In city.csv I have a Colname that is called name. I want all data under that colname name to be upper. – Chris Kehl Dec 4 '18 at 15:04
• in that case all you need to do is colnames(dataframe) <- toupper(colnames(dataframe)) – Mohammed.T Dec 4 '18 at 15:11
• didn't work. colnames(city$name) <- toupper(colnames(city$name)) – Chris Kehl Dec 4 '18 at 23:22
• city[,2] = toupper(city[,2]) worked – Chris Kehl Dec 5 '18 at 0:29
• Again your question was quite unclear, please try to be more clear. – Mohammed.T Dec 5 '18 at 9:57