1

我想找到皮尔逊相关性。#cols 是 100,#rows 是 300。我正在使用以下命令:

library(Hmisc)

x <- (read.csv("input.csv",header=TRUE))
y <- rcorr(as.matrix(as.numeric(x)), type="pearson")

Error in as.matrix(as.numeric(x)) : 
  (list) object cannot be coerced to type 'double'

我已经尝试了所有组合来解决这个错误。任何人都可以帮助我吗?

我的一些数据是

                        A   B    C    D    E    F 
        221974_at      9.01 8.85 9.27 9.57 9.65 8.83 
        216850_at      6.91 6.79 6.8 7.34 6.78 7.16 
        215559_at      7.79 6.42 7.11 5.6 6.55 5.88 
        1570255_s_at   5.43 6.55 4.76 6.34 5.42 6.3 
        1554245_x_at   5.85 6.45 5.91 6.23 7.03 6.65 
        1553607_at     5.44 5.44 4.84 3.7 3.24 5.39 
        244766_at      8.08 8.44 8.44 8.81 8.36 8.45 

我也在输入文件中给出了这个标题。

4

0 回答 0