[R] R-commands for MDS

Uwe Ligges ligges at statistik.tu-dortmund.de
Fri Feb 19 17:59:31 CET 2010



On 18.02.2010 11:24, Oduor Olande wrote:
>
>
>
> Hello
> I am using the following command but not able to text the values on the graph can
> someone please make suggestions for improvement

Perhaps dist.r does not have row.names(dist.r) nor colnames(dist.r)?
We cannot know since we do not have dist.r.

Uwe Ligges



>
>   #here is the command
> loc_mds<- cmdscale(dist.r, k = 7, eig = TRUE)
>   loc_mds$eig
>
> sum(abs(loc_mds$eig[1:2]))/sum(abs(loc_mds$eig))
> sum((loc_mds$eig[1:2])^2)/sum((loc_mds$eig)^2)
> x<-loc_mds$points[,1]
> y<-loc_mds$points[,2]
> plot(x, y, xlab="Coordinate 1",
> ylab="Coordinate 2",
> main="Metric MDS", type="n")
>
> text(x, y, labels = row.names(dist.r), cex=.7)#the same as the last code
> text(x, y, labels = colnames(dist.r))# I am not getting the drawing why?
>
> With Kind regards 		 	   		
> _________________________________________________________________
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list