[R-sig-eco] Data Frame Structure for vegdist()
Martin Weiser
weiser2 at natur.cuni.cz
Mon Nov 11 11:02:47 CET 2013
Rich Shepard píše v Čt 07. 11. 2013 v 12:38 -0800:
> I have data frames on which I want to calculate the default Bray-Curtis
> dissimilarity matrix using vegdist() in the vegan package. The data are
> proportions of individuals in each of 5 categories with the first column as
> the collection date. One such data frame is:
>
> sampdate filter gather graze predate shred
> 1 2004-06-17 0.0093 0.8881 0.0295 0.0685 0.0046
> 2 2005-07-18 0.0149 0.8402 0.0951 0.0467 0.0030
> 3 2006-06-29 0.0217 0.7538 0.1185 0.1006 0.0055
> 4 2011-07-14 0.0241 0.8408 0.0645 0.0625 0.0081
> 5 2012-07-10 0.0114 0.4877 0.0256 0.2936 0.1818
>
> Am I correct in assuming that I need to remove the sampdate column?
>
> Rich
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Dear Rich,
I guess you are asking because you wish to retain your sampling dates as
labels.
(If not, throw them away. If they say something you wish to base your
distances on (e.g. some important phenological date, peak of some
organism or characteristic), then retain them.)
If you just need labels:
newdata <- olddata[,2:length(olddata)]
rownames(newdata) <- olddata[,1]
HTH,
Martin Weiser
More information about the R-sig-ecology
mailing list