[R] plot(corresp(data)...)

Gabor Grothendieck ggrothendieck at gmail.com
Thu Jun 9 15:04:40 CEST 2005


On 6/9/05, Navarre Sabine <navarre_sabine at yahoo.fr> wrote:
> hi,
> 
> My code:
> 
> data<-matrix(data=c(0.425,0.5,0.75,0.125,0.25,0.475,0.375,0.25,0.625,0.5,0.1,0.125,0,0.25,0.25),nrow=3,ncol=5,byrow=TRUE, dimnames=list(c("Good","Medium","Bad"),c("Content","Logistic","Trainer","Supply","User contribution")))
> 
> plot(corresp(data,nf=2),xlim=c(-1,1),ylim=c(-1,1));
> 
> The plot is illegible, 

Here is the code I have been using for plotting the columns.  It should be
relatively simple to extend this to plot the rows too. 

colplot <- function(x, names = rownames(x$cs), cex = .6, adj = 1.5, ...) {
   plot(x$cs, ...)
   text(x$cs, names, cex = cex, adj = adj)
   arrows(0,0,x$cs[,1],x$cs[,2],len=.1,col="red")
   abline(h=0, v=0)
   invisible(x$cs)
}
colplot(corresp(data, nf = 2), xlim = c(-2,2), cex = .5)




More information about the R-help mailing list