R 运行相关分析时出错

R 运行相关分析时出错,r,R,我试图使用R运行相关分析,使用Hmisc::rcorr找到皮尔逊系数。但是,我需要帮助理解错误消息。有人能帮帮这个新手吗 这是我正在使用的代码 library(Hmisc) rcorr(Rintro_Chapter4_June_12$age, Rintro_Chapter4_June_12$credit.score, type = "pearson") 这是我收到的错误消息 Error in rcorr(Rintro_Chapter4_June_12$age, Rintro_Chapter4_

我试图使用R运行相关分析,使用
Hmisc::rcorr
找到皮尔逊系数。但是,我需要帮助理解错误消息。有人能帮帮这个新手吗

这是我正在使用的代码

library(Hmisc)
rcorr(Rintro_Chapter4_June_12$age, Rintro_Chapter4_June_12$credit.score, type = "pearson")
这是我收到的错误消息

Error in rcorr(Rintro_Chapter4_June_12$age, Rintro_Chapter4_June_12$credit.score,:
   unused arguments (Rintro_Chapter4_June_12$credit.score, type = "pearson")
多谢各位


Luis

rcorr()
需要一个矩阵作为输入,而您需要给出两个向量。谢谢你,Bea,你知道我如何修复这个错误吗?讲师使用相同的代码和数据集进行相关性分析,没有发现错误。请尝试
rcorr(cbind(Rintro\u Chapter 4\u June\u 12$age,Rintro\u Chapter 4\u June\u 12$credit.score),键入=“pearson”)