Example R programs and commands 29. Multidimensional scaling # All lines preceded by the "#" character are comments or output. # All other left-justified lines are my input ###################### Isomap in R ############ # # Isomap builds a graph from the data, connecting only nearby points # with edges. install.packages("vegan") # This contains "isomap()" library(vegan) ### Build the isomap graphs for 3 iris species data(iris); # Recall: 3 species, 50 plants each, 4-variate data # Isomap graphs, k=3 nearest neighbors by Euclidean distance y<-iris[iris$Species=="setosa",1:4] idist <- dist(y); imap<-isomap(idist,k=3); plot(imap) y<-iris[iris$Species=="versicolor",1:4] idist <- dist(y); imap<-isomap(idist,k=3); plot(imap) y<-iris[iris$Species=="virginica",1:4] idist <- dist(y); imap<-isomap(idist,k=3); plot(imap)