test1 <- c("1","2","3")
df1 <- data.frame(test1)
is.numeric(df1)
[1] FALSE
as.numeric(df1)
Error: (list) object cannot be coerced to type 'double'
as.numeric(as.character(df1))
[1] NA
Warning message:
NAs introduced by coercion
请问如何才能将数据框中的数据转换为数值型的?谢谢