Below are few scenarios for changing cases(upper to lower and vice ) of column_name or column_value in R .

Scenario -1 (Changing column names from upper case to Lower case)

Library used - > Data.table
Syntax ->setnames(),tolower()

-- Example

df=setnames(df, tolower(names(df[1:3])))

Note: in the above example [1:3] means the range of the columns , i.e. 1st column to 3rd column

 

 

Scenario -2 (Changing column names from Lower case to Upper case)

Library -> Data.table
Syntax  -> setnames(),toupper()

-- Example 

df=setnames(df, toupper(names(df[1:3])))

Note: in the above example [1:3] means the range of the columns. i.e. 1st column to 3rd column

 

 

Scenario -3 (Changing column values from upper case to Lowe case)

Library -> Not Applicable
Syntax   -> tolower()

-- Example

df$product_id=tolower(df$product_id)

 

 

Scenario -4 (Changing Column values from Lower case to Upper case)

Library  -> Not Applicable
Syntax   -> toupper()

-- Example

df$product_id=toupper(df$product_id)

 

R-STUDIO