[R] problem with corrgram function

Niels Janssen njanssen at ull.es
Tue Jun 28 13:11:04 CEST 2011


Dear list,

I have a problem with the "corrgram" function. It does not seem to 
"color" large negative correlations, while the same correlation, if 
positive, provides no problems. Is this a bug?

	require(corrgram)	
	a = seq(1,100)
	b = -jitter(seq(1,100), 80)
	cor(a,b) # r about -.96
	c=as.data.frame(cbind(a,b))
	corrgram(c, order=NULL, lower.panel=panel.pie,upper.panel=NULL, 
text.panel=panel.txt) # no color
	
	c$b = -1*c$b # flip direction of correlation
	cor(c$a, c$b) # r now about +.96
	corrgram(c, order=NULL, lower.panel=panel.pie,upper.panel=NULL, 
text.panel=panel.txt) #no problem with color.

Thanks!



More information about the R-help mailing list