使用table的多个相关性。PerformanceAnalytics

时间:2018-04-24 00:56:22

标签: r correlation performanceanalytics

我正在尝试从不是时间序列的数据集中运行多个相关性。我发现包PerformanceAnalytics是最好的输出。但是,我一直都会返回错误

library("PerformanceAnalytics")
my_data <- mtcars[, c(1,3,4,5,6,7)]    
table.Correlation(my_data[,1], my_data[,2:6])
        Error in checkData(Rb) : 
      The data cannot be converted into a time series.  If you are trying to pass in names from a data object with one column, you should use the form 'data[rows, columns, drop = FALSE]'.  Rownames should have standard date formats, such as '1985-03-15'

但是,包文档说明我可以使用矢量,矩阵,data.frame和其他格式。实际上,我甚至可以运行相关,但使用函数chart.Correlation

chart.Correlation(my_data, histogram=TRUE, pch=19)

有谁知道如何解决这个问题?

0 个答案:

没有答案