I have a number of dissimilarity matrices built in another program that I'd 
like to subset then run NMS.

#read in distance matrix
b_bc03 <-data.matrix(read.table("bac_final.an.thetayc.0.03.lt.ave.dist", 
row.names=1, header=T, fill=TRUE))  # creates a 736x736 double matrix

#read in environmental variables
 bac_env<-read.csv("bac_samples.csv", row.names=1, header=T)  # 736 obs. of 6 
variables

#The only way that I've figured out how to subset a lt matrix is to convert to 
dist object first
bc_dist<-as.dist(b_bc03)  # dist[27048]
tx_dist<-subset(bc_dist, bac_env$zone=="TX") # numeric[54316]

Here is where it falls apart, the subset doesn't keep the labels, just the 
values so I can't convert it back to a distance matrix.  I've looked through 
ecodist but can't find anyway in that package to select only certain samples.

Help please?

thanks
Kendra



--
Kendra Maas Mitchell, Ph.D.
Post Doctoral Research Fellow
University of British Columbia
604-822-5646

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

Reply via email to