Dear all:

I have an issue in correctly transferring the attached data frame to a matrix to be processed in the R package DispRity.

I am running the following script that (1) reads in the attached dataframe from Excel, (2) tansfers it to a matrix X and (3) uses the column "subgroup" to define the two groups I want to work on.

Her is the script I am using:

#___

library (dispRity)

#(1) Reading dataframe
Data<-read.csv2("test.csv", row.names=1, header = T, fileEncoding="UTF-8-BOM")

#(2) converts dataframe into a matrix
X<-data.matrix(Data)

#(3)define subsets
custom.subsets(X[, c(1,2)], group = as.factor(X[, 3]))

#___

However, once I have run the third line, I am getting an error message such as:

Error: group argument must be either a "list", a "matrix", a "data.frame" or a "phylo" object.

____

If I change the third line into: custom.subsets(dat[, c(2,3)], group = as.factor(dat[, 4])), the error message is as follows:

Error in X[, 4] : subscript out of bounds
___


I will be very happy if anybody can give a hint how to resolve this problem.


My best wishes,

Oliver Betz











Species;PC1;PC2;subgroups
Sp1;-,99402;-,83812;1
Sp2;-,56798;-1,48448;1
Sp3;-1,44696;-,38381;1
Sp4;-1,43304;,08285;1
Sp5;-1,49947;-,54767;1
Sp6;-1,03741;-1,26732;1
Sp7;-1,53576;,51212;1
Sp8;-2,41595;,42931;1
Sp9;-,53884;-,55680;1
Sp10;-1,00361;-,26889;1
Sp11;-,94609;-,51118;1
Sp12;-,69936;-1,01976;1
Sp13;-,50821;-,91373;1
Sp14;-1,55634;1,90676;1
Sp15;,38214;-1,54963;1
Sp16;-,20776;-,72754;1
Sp17;,53908;-1,89034;1
Sp18;,76212;,50566;2
Sp19;,83697;,40428;2
Sp20;,39599;,89889;2
Sp21;,08640;,73930;2
Sp22;,10148;1,55637;2
Sp23;,45774;1,02045;2
Sp24;,50159;1,62344;2
Sp25;1,71349;-,15227;2
Sp26;,50170;,72145;2
Sp27;,80535;-,02320;2
Sp28;,31276;,17559;2
Sp29;,39681;1,52969;2
Sp30;,85238;-,28661;2
Sp31;1,05400;-,82751;2
Sp32;,78774;,08827;2
Sp33;1,06829;,30410;2
Sp34;,45918;,42574;2
Sp35;,61022;,14773;2
Sp36;,23850;2,11037;2
Sp37;,45708;,61214;2
Sp38;1,60977;-1,23980;2
Sp39;1,46004;-1,30585;2
_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to