Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
访问R中的输出自corr.test()_R - Fatal编程技术网

访问R中的输出自corr.test()

访问R中的输出自corr.test(),r,R,我想访问R中由命令corr.test()生成的各个表。我有一个包含8行18列的数据框。运行corr.test(data.frame)后,它生成了我想要的输出,但无法单独访问表。有解决办法吗 corr.test(JK[2:18]) JK2<-(corr.test(JK[2:18])) JK2 corr.test(JK[2:18]) JK2假设您引用的是psych包中的函数,您只需将表作为列表中的项目访问即可 require(psych) dat <- data.frame(matri

我想访问R中由命令
corr.test()
生成的各个表。我有一个包含8行18列的数据框。运行
corr.test(data.frame)
后,它生成了我想要的输出,但无法单独访问表。有解决办法吗

corr.test(JK[2:18])
JK2<-(corr.test(JK[2:18]))
JK2
corr.test(JK[2:18])

JK2假设您引用的是
psych
包中的函数,您只需将表作为列表中的项目访问即可

require(psych)
dat <- data.frame(matrix(sample(8*18), 8, 18))
out <- corr.test(dat[2:18])
并可以使用列表索引访问生成的八个表:

out[[1]] # Correlation matrix 
out[[2]] # Sample Size
out[[3]] # Probability values
# and so on

你用的是哪种包装?
out[[1]] # Correlation matrix 
out[[2]] # Sample Size
out[[3]] # Probability values
# and so on