Re: [R] R-commands for MDS

2010-02-19 Thread Uwe Ligges



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@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.


__
R-help@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.


[R] R-commands for MDS

2010-02-18 Thread Oduor Olande


 
Hello
I am using the following command but not able to text the values on the graph 
can
someone please make suggestions for improvement

 #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@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.