Sorry, wrong code. The right one here:
library(MASS)
cl<-read.table("e:/data.txt",header=T,sep=",")
row.names(cl)<-colnames(cl)
cm<-as.matrix(cl)
loc<-sammon(cm)
jpeg(filename="e:/plot.gif",width = 480, height = 480, units =
"px",
pointsize = 12, quality = 75, bg = "white", res = NA, restoreConsole =
TRUE)
plot(loc$points,type="p")
text(loc$points,rownames(cl),cex=1,pos=1,offset=1)
dev.off()
And "e:/data.txt" contains a 40*40 dissimilarity matrix. Thanks for
you
advices!
2008/9/3, ³ÂÎä <geminiwhu@gmail.com>:>
> I apply isoMDS to my data, but the result turns out to be bad as the stress
> value stays around 31! Yeah, 31 ,not 3.1... I don't know if I ignore
> something before recall isoMDS.
> My code as follow:
>
> m <- read.table("e:/tsdata.txt",header=T,sep=",")
> article_number <- ts(m, start = 2004,end=2008, frequency = 1
> ,names=colnames(m))
> jpeg(filename="e:/tsmap.gif",width = 480, height = 480, units =
"px",
> pointsize = 12, quality = 75, bg = "white", res = NA,
restoreConsole = TRUE)
> plot(article_number, plot.type="single",
> lty=c(1,1,1,1,1),col=c(1,2,3,4,5),las=1)
> max<-range(m)
> x<-c(2004,2004,2004,2004,2004)
>
>
y<-c(max[2]*0.96,max[2]*0.9199999999999999,max[2]*0.88,max[2]*0.84,max[2]*0.7999999999999999)
> points(x,y,col=c(1,2,3,4,5),pch=15)
> text(x,y,colnames(m),pos=4,offset=0.4)
> dev.off()
>
> A 40*40 matrix in "e:/tsdata.txt". How should I do to improve the
effect?
> Thank you!
>
[[alternative HTML version deleted]]