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

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Thu 09 Jun 2005 - 23:04:40 EST

On 6/9/05, Navarre Sabine <navarre_sabine@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)



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jun 09 23:17:04 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:28 EST