Hi, Sorry for the simple question, but I am getting an error when using Phytools rerootingMethod function, and I can’t figure it out.
Error in `colnames<-`(`*tmp*`, value = c("Haw", "Kau", "Mau", "Oah")) : attempt to set 'colnames' on an object with less than two dimensions Thanks, Jackie ———————————————— > symbTree <- read.nexus("symbiontMCCTree.nex") > symbTree Phylogenetic tree with 20 tips and 13 internal nodes. Tip labels: PnewKa1, PvitMo1, TwaiMa1, TarbHa1, TbeaMa1, TcraMa1, ... Rooted; includes branch lengths. > symIsland<-read.table("symbiontIsland.txt") > symIsland V1 V2 1 PnewKa1 Kau 2 PvitMo1 Mau 3 TwaiMa1 Mau 4 TarbHa1 Haw 5 TbeaMa1 Mau 6 TcraMa1 Mau 7 TdubKa1 Kau 8 TdubOa1 Oah 9 TdubMa1 Mau 10 TjoiKa1 Kau 11 TjoiMa1 Mau 12 TjoiMo1 Mau 13 TpanHa1 Haw 14 TpanHa2 Haw 15 TpohHa1 Haw 16 TartMa1 Mau 17 TperKa1 Kau 18 TdenMa1 Mau 19 TsweKa1 Kau 20 TsweMa1 Mau > island<-symIsland[,2] > island [1] Kau Mau Mau Haw Mau Mau Kau Oah Mau Kau Mau Mau Haw Haw Haw Mau Kau Mau Kau [20] Mau Levels: Haw Kau Mau Oah > names(island)<-symIsland[,1] > island PnewKa1 PvitMo1 TwaiMa1 TarbHa1 TbeaMa1 TcraMa1 TdubKa1 TdubOa1 TdubMa1 TjoiKa1 Kau Mau Mau Haw Mau Mau Kau Oah Mau Kau TjoiMa1 TjoiMo1 TpanHa1 TpanHa2 TpohHa1 TartMa1 TperKa1 TdenMa1 TsweKa1 TsweMa1 Mau Mau Haw Haw Haw Mau Kau Mau Kau Mau Levels: Haw Kau Mau Oah > islandRecon<-rerootingMethod(symbTree,island,model="ER") Error in `colnames<-`(`*tmp*`, value = c("Haw", "Kau", "Mau", "Oah")) : attempt to set 'colnames' on an object with less than two dimensions ----------------- Jackie (Jonathan M.) Brown Professor of Biology Grinnell College, IA, USA _______________________________________________ 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/