2

我正在尝试使用 Corrgram 包中的标签参数来绘制垂直轴和水平轴,但我遇到了严重的困难。我尝试通过标签参数传递我的变量名,但我的标签仍然在对角线上。我的代码如下:

correlations <- c("var1","var2",...,"varx") ##Hosts my variable names.

corrgram(total.sub[,correlations],labels=correlations,lower.panel=panel.shade,upper.panel=panel.pie)

编辑:下面是一个可重现的例子:

library(corrgram)
a = c(19,21,31,41)
b = c(21,42,191,1)
c = c(1,2,3,4)
d = c(.1,39,42,1)
e = c(52,239,19,2)

df = data.frame(a,b,c,d,e)
correlations <-c("a","b","c","d","e")
corrgram(df[,correlations],labels=correlations,lower.panel=panel.shade,upper.panel=panel.pie)
4

0 回答 0