我有一个看起来像这样的数据:
GO:2000974 7,8 negative_regulation_of_pro-B_cell_differentiation Notch1 ISS
GO:2000974 7,8 negative_regulation_of_pro-B_cell_differentiation Q9W737 IEA
GO:0001768 4 establishment_of_T_cell_polarity Ccl19 IEA
GO:0001768 4 establishment_of_T_cell_polarity Ccl19 ISS
GO:0001768 4 establishment_of_T_cell_polarity Ccl21 IEA
我想要做的是将 的文本大写第四 柱子。
例如,现在我们有
Notch1
,然后它会被转换为 NOTCH1
.在 R 中这样做的方法是什么?我坚持这个:
dat<-read.table("http://dpaste.com/1353034/plain/")
最佳答案
只需使用 toupper
功能:
R> toupper(c("a", "ab"))
[1] "A" "AB"
对于您的数据框,您将拥有:
dat[,4] = toupper(dat[,4])
关于r - 将 R 数据框中特定列的文本大写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18374986/