使用Hmisc软件包查找与R中p值的相关性

使用Hmisc软件包查找与R中p值的相关性,r,dataframe,correlation,hmisc,R,Dataframe,Correlation,Hmisc,我试图在R中找到数据帧变量之间的相关性。我的数据帧头部在下面 > head(datafile) Taxon Petals Internode Sepal Bract Petiole Leaf Fruit 1 I 5.621498 29.48060 2.462107 18.20341 11.27910 1.128033 7.876151 2 I 4.994617 28.36025 2.429321 17.65205 11.04084

我试图在R中找到数据帧变量之间的相关性。我的数据帧头部在下面

> head(datafile)

  Taxon   Petals Internode    Sepal    Bract  Petiole     Leaf    Fruit
1     I 5.621498  29.48060 2.462107 18.20341 11.27910 1.128033 7.876151
2     I 4.994617  28.36025 2.429321 17.65205 11.04084 1.197617 7.025416
3     I 4.767505  27.25432 2.570497 19.40838 10.49072 1.003808 7.817479
4     I 6.299446  25.92424 2.066051 18.37915 11.80182 1.614052 7.672492
5     I 6.489375  25.21131 2.901583 17.31305 10.12159 1.813333 7.758443
6     I 5.785868  25.52433 2.655643 17.07216 10.55816 1.955524 7.880880
下面是我用来查找数据帧的代码

#correlation
install.packages("Hmisc")
library(Hmisc)
rcorr(as.matrix(datafile))
当我尝试这样做时,我得到了以下错误

> rcorr(as.matrix(datafile))
Error in rcorr(as.matrix(datafile)) : 
  NA/NaN/Inf in foreign function call (arg 1)
In addition: Warning message:
In storage.mode(x) <- "double" : NAs introduced by coercion
rcorr(as.matrix(数据文件)) rcorr(as.matrix(数据文件))中出错: 外部函数调用中的NA/NaN/Inf(arg 1) 此外:警告信息:
在storage.mode(x)中是的,正如评论所说。我必须排除可变分类单元,它不是数字

您可能需要排除名为
Taxon
的第一列。在我看来不是很数字化。