有字符矩阵以及我如何在R中转换为数字? 我使用几个代码,如:as.numeric(as.character(df)); lapply(df,as.numeric); sapply(df,as.numeric);但没有获得优势!
df[1:5,1:10]
id G_r78 G_09 G_r805 G_800
1 "02000H1" NA "1" "2" "1"
2 "02000H15" NA "0" "1" "2"
3 "02003H10" NA "1" "1" "1"
4 "02003KH8" NA "0" "1" "1"