Capitalizing text of a specific column in R's data frame

前端 未结 1 1092
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-18 04:34

I have a data that looks like this:

GO:2000974 7,8 negative_regulation_of_pro-B_cell_differentiation Notch1 ISS
GO:2000974 7,8 negative_regulation_of_pro-B_c         


        
1条回答
  •  无人及你
    2021-01-18 05:14

    Just use the toupper function:

    R> toupper(c("a", "ab"))
    [1] "A"  "AB"
    

    For your data frame, you will have:

    dat[,4] = toupper(dat[,4])
    

    0 讨论(0)
提交回复
热议问题