[R] Vegan vegdist Jaccard matrix problem
Jari.Olsanen
jari.oksanen at oulu.fi
Mon Sep 24 07:19:09 CEST 2012
kbannarm <kbannarm <at> hotmail.com> writes:
>
> This is my script:
>
> Madr<-read.csv("MadRegSppSite.csv", sep=",", row.names=1)
> rownames(Madr) <- Madr[,1]
> Madr <- Madr[,-1]
> MadrJaccard<-vegdist(Madr, method="jaccard",binary=FALSE)
> MadrJaccard<-as.matrix(dist(MadrJaccard))
> write.table(MadrJaccard,file="MadrJaccard.csv",sep=",",row.names=T)
>
> The input file is a binary matrix of presence absence of species organized
> in rows, and sites in the first column.
> The script is running fine but when I open it in excel (MadrJaccard) the
> Jaccard values are between 0 and 4 when the range of values is only supposed
> to be between 0 and 1.
>
> I cannot figure out what is going on, does anyone have any ideas?
>
You should carefully re-read yout script.
The key line contains dist(MadrJaccard) which calculates Euclidean
distances of Jaccard dissimilarities. Do not calculate metadistances.
Cheers, Jari Oksanen
More information about the R-help
mailing list