Convert from lowercase to uppercase all values in all character variables in dataframe

前端 未结 7 751
萌比男神i
萌比男神i 2020-12-05 09:17

I have a mixed dataframe of character and numeric variables.

city,hs_cd,sl_no,col_01,col_02,col_03
Austin,1,2,,46,Female
Austin,1,3,,32,Male
Austin,1,4,,27,         


        
7条回答
  •  旧巷少年郎
    2020-12-05 09:48

    Alternatively, if you just want to convert one particular row to uppercase, use the code below:

    df[[1]] <- toupper(df[[1]])
    

提交回复
热议问题