-1
嘗試使用Deducer
的cor.matrix
創建ggcorplot
中要使用的相關矩陣。在cor.matrix中指定變量
試圖運行一個簡單的例子。只有在數據工作中明確指定變量名稱:
cor.mat<-cor.matrix(variables=d(Sepal.Length,Sepal.Width,Petal.Length,Petal.Width),
data=iris[1:4],test=cor.test,method='p')
但我希望它能夠簡單地使用提供的數據中的所有列。
此:
cor.mat<-cor.matrix(data=iris[1:4],test=cor.test,method='p')
拋出一個錯誤:
Error in eval(expr, envir, enclos) : argument is missing, with no default
此:
cor.mat<-cor.matrix(variables=d(as.name(paste(colnames(iris)[1:4]),collapse=",")),
data=iris[1:4],test=cor.test,method='p')
Error in as.name(paste(colnames(iris)[1:4]), collapse = ",") :
unused argument (collapse = ",")
那麼,有沒有辦法告訴variables
使用的所有列在data
沒有明確指定他們?
@丹沒有這個解決您的問題?如果是這樣,請考慮upvoting /接受答案。 – dww