Hello R-Users,

its again me with a question.
I´m using R 2.5.0 on Mac Power Book running Mac OS X 10.4.10

I try to calculate distances betweeen two data tables looking like this

     V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18  
V19 V20 V21 V22 V23 V24 V25 V26 V27 V28 V29 V30 V31 V32 V33 V34 V35 V36
1    1  0  0  0  1  1  0  1  0   0   0   1   0   0   0   0   0   1    
0   0   1   0   0   0   0   1   1   0   1   1   0   0   0   0   0   0
2    1  1  0  0  1  1  0  0  1   0   1   1   0   0   0   0   0   1    
0   0   1   0   0   0   0   1   1   0   0   1   0   0   1   1   0   0
3    1  1  0  0  1  1  1  1  0   0   1   0   0   0   0   0   0   1    
0   0   1   1   0   0   0   0   1   0   1   0   0   1   0   0   0   0
4    0  1  0  0  1  1  0  1  0   0   0   1   0   0   0   0   0   1    
0   0   1   0   0   1   0   0   1   0   0   1   0   0   1   0   0   0
5    0  1  0  0  1  1  0  0  1   0   0   1   1   0   0   0   0   1    
0   0   1   0   0   0   0   1   0   0   0   1   0   0   0   0   0   0
6    1  1  0  0  1  1  0  1  1   0   1   0   0   0   0   0   1   1    
0   0   1   0   0   0   0   0   1   0   0   1   0   1   1   0   0   0

As i know I did the same 2 weeks ago and it worked properly.

Here are my codes:

Table1<-read.table("Alle_DatenFemBeschr4a.csv", sep = ";")

Table0<-read.table("Alle_DatenMalBeschr4a.csv", sep = ";")

Dist.Gower<- distance(Table1 ,Table0 ,method ="mixed", weights = c 
(0.3333333, 0.3333333, 0.3333333, 0.5000000, 0.5000000, 0.5000000,  
0.5000000, 0.5000000, 0.5000000, 0.2500000, 0.2500000, 0.2500000,  
0.2500000, 0.1428571, 0.1428571, 0.1428571, 0.1428571, 0.1428571,  
0.1428571, 0.1428571, 0.3333333, 0.3333333, 0.3333333, 0.2000000,  
0.2000000, 0.2000000, 0.2000000, 0.2000000, 0.1111111, 0.1111111,  
0.1111111, 0.1111111, 0.1111111, 0.1111111, 0.1111111, 0.1111111,  
0.1111111, 0.2000000, 0.2000000, 0.2000000, 0.2000000, 0.2000000,  
0.1428571, 0.1428571, 0.1428571, 0.1428571, 0.1428571, 0.1428571,  
0.1428571, 0.1428571, 0.1428571, 0.1428571, 0.1428571, 0.1428571,  
0.1428571, 0.1428571, 0.2000000, 0.2000000, 0.2000000, 0.2000000,  
0.2000000, 0.5000000, 0.5000000, 0.5000000, 0.5000000, 0.5000000,  
0.5000000, 0.5000000, 0.5000000, 0.5000000, 0.5000000, 0.5000000,  
0.5000000, 0.5000000, 0.5000000, 0.5000000, 0.5000000, 0.5000000,  
0.5000000, 0.5000000, 0.5000000, 0.5000000, 0.5000000, 0.5000000,  
0.5000000))

This produces the following massage:

Fehler in distance(Table1, Table0, method = "mixed", weights = c 
(0.3333333,  :
	Different columns (species) are coded as factors in 'x' and 'y'

I thought that the data format in the tables were not congruent in  
the same columns but I checked this and it is not the case.

I also tried to convert the data into a matrix (as.matrix) or a  
dataframe (as.data.frame) but the result was the same. Perhaps it is  
only a small syntax error but I am R beginner.

I hope somebody wil help me and thank you all in advance.

Kind regards

Birgit

Birgit Lemcke
Institut für Systematische Botanik
Zollikerstrasse 107
CH-8008 Zürich
Switzerland
Ph: +41 (0)44 634 8351
birgit.lemcke@systbot.uzh.ch






	[[alternative HTML version deleted]]

