[R] Dissimilarity Analysis

stephen cox myrddincox at gmail.com
Wed Jun 20 15:49:44 CEST 2007


Hi Birgit - looks like you have a few issues here.

Birgit Lemcke <birgit.lemcke <at> systbot.uzh.ch> writes:

> 
> Hello you all!
> 
> I am a completely new user of R and I have a problem to solve.
> I am using Mac OS X on a PowerBook.
> 
> I have a table that looks like this:
> 
>             species X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14  
> X15 X16 X17 X18 X19 X20 X21
> 1        Anth_cap1  1  0  0  1  0  1  0  0  1   0   0   0   0   0    
> 0   0   1   0   0   0   1
> 2       Anth_crin1  1  0  0  1  0  1  0  0  1   0   1   0   0   0    
> 0   0   0   1   0   0   1
> 3        Anth_eck1  1  0  0  1  0  1  0  0  1   0   0   0   0   0    
> 0   0   0   1   0   0   1
> 4       Anth_gram1  1  0  0  1  0  1  0  0  1  NA  NA  NA  NA   0    
> 0   0   0   1   0   0   0
> 5       Anth_insi1  1  0  0  1  0  1  0  0  1   0   0   0   1   0    
> 0   0   0   1   0   0   1
> 
> All columns  are binary coded characters.
> The Import was done by this
> 
> Test<-read.table("TestRFemMalBivariat1.csv",header = TRUE, sep = ";")

First - you need to transpose the matrix to have species as columns.  You can do
this with:

d2 = data.frame(t(Test[,-1]))
colnames(d2) = Test[,1]  #now use d2


 
> Now I try to perform a similarity analysis with the dsvdis function  
> of the labdsv package with the sorensen-Index.
> 
> My first question is if all zeros in my table are seen as missing  
> values and if it islike that how can I change without turning zero  
> into other numbers?

no - the zeros are valid observations.  the na's are missing data.


>   DisTest<-dsvdis(Test, index = "sorensen")
> 
> But I always get back this error message:
> 
> Warnung in symbol.For("dsvdis") :'symbol.For' is not needed: please  
> remove it
> Fehler in dsvdis(Test, index = "sorensen") :
> 	NA/NaN/Inf in externem Funktionsaufruf (arg 1)
> Zusätzlich: Warning message:
> NAs durch Umwandlung erzeugt



Second - you have an issue with missing data.  It looks like dsvdis does not
like the NA's - so you must make a decision about what to do.  Delete that
species, delete that site, or whatever...

Finally - the warning over symbol.For is an issue with the labdsv library itself
- nothing you are doing wrong.  The results will still be valid - but the use of
symbol.For is something that will eventually need to be changed in the labdsv
library.

hth,

stephen



More information about the R-help mailing list