[R-sig-eco] tree format for phylosignal function
Dear all, I'm trying to run the Kcalc and the phylosignal functions on the following tree in Newick format: (((Tai:0,Por:0):0,S.Af:0):0,Spa:0):0,(CSR140:0,(Col:0,Engl:0):0):0):0.029,(Pol:0,(Fin:0,(S.Afr:0,(CSR19:0,(Spazx:0,(Grez:0,Marys:0):0):0):0):0):0.0063):0.0705):0.0156,(Tenn:0,(Sw:0,(Sp:0, Uta:0):0):0):0.0818):0.0792,(Colsd:0.0032,(S.Afasd:0,(Tensad:0,(N.Caasd:0,(Huad:0,(Polad:0,(Taad:0,Spaad:0):0):0):0):0):0):0.0032):0.0889,Sead:1.37675463); and I get the following error Error in Initialize.corSymm(X[[1L]], ...) : Initial values for corSymm must be between -1 and 1 Doed anyone have any idea how to solve this? Thank you, Monica [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] rarefaction not working with the min species number
On 24/04/2012, at 15:39 PM, Stephen Sefick wrote: I will provide reproducible code if I need to. All: I am trying to set up a 1000 pulls of a community data frame for calculating richness measures. I would like to be able to code the sample number based on the minimum of all of the samples. I can do this but there is an error: Error in sample(rep(nm, times = x[i, ]), sample[i]) : cannot take a sample larger than the population when 'replace = FALSE' when using: rrarefy(L, min(apply(L, 1, sum))) min is returning the lowest sample abundance of all of the samples. rrarefy works if I subtract 5 (arbitrary) from the min(...) statement. I am sure that I am missing something simple. many thanks, Stephen, I can reproduce this if input data ('L') contain non-integer data. The function is only able to handle integer data, but it does not check the input. Probably it should: the error would still be there, but the message would be more informative. Cheers, Jari -- Jari Oksanen, Dept Biology, Univ Oulu, 90014 Finland ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] rarefaction not working with the min species number
Jari, Many thanks, that did the trick. Here is a little bit of code that took my non-integer data (abundance estimates), rounds, and turns the numbers into a data.frame with all integers col classes. community_round2int - function(L){ row - rownames(L) a - as.data.frame(apply(L, 2, round)) b - as.data.frame(apply(a, 2, as.integer)) rownames(b) - row return(b) } kindest regards, Stephen On Tue 24 Apr 2012 08:01:16 AM CDT, Jari Oksanen wrote: On 24/04/2012, at 15:39 PM, Stephen Sefick wrote: I will provide reproducible code if I need to. All: I am trying to set up a 1000 pulls of a community data frame for calculating richness measures. I would like to be able to code the sample number based on the minimum of all of the samples. I can do this but there is an error: Error in sample(rep(nm, times = x[i, ]), sample[i]) : cannot take a sample larger than the population when 'replace = FALSE' when using: rrarefy(L, min(apply(L, 1, sum))) min is returning the lowest sample abundance of all of the samples. rrarefy works if I subtract 5 (arbitrary) from the min(...) statement. I am sure that I am missing something simple. many thanks, Stephen, I can reproduce this if input data ('L') contain non-integer data. The function is only able to handle integer data, but it does not check the input. Probably it should: the error would still be there, but the message would be more informative. Cheers, Jari -- Jari Oksanen, Dept Biology, Univ Oulu, 90014 Finland ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- Stephen Sefick ** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama 36849 ** sas0...@auburn.edu http://www.auburn.edu/~sas0025 ** Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis A big computer, a complex algorithm and a long time does not equal science. -Robert Gentleman ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
[R-sig-eco] graphics window fails to contain all points with ordicluster
I up-graded to R version 2.15.0. Now script that I had run successfully in version 2.12 cannot complete an identify-ordicluster in this version. My vegetation transect data is sub-setted to treat different life forms separately. A call for all the vegetation graphs successfully, with all 22 rows (points) shown, as does one of the sub-sets, but the others only display 20 points, so that the identify function cannot be completed. Here is my script, with one subset (Perennial.Forb) that plots successfully, and another (shrub) that does not. My dataset (richness data) is attached. Q08.Q09 -as.data.frame(read.table(file.choose(),header=T)) library(labdsv) library(vegan) Shrub -Q08.Q09[c(1:11,22:32),1:27] Perennial.Forb -Q08.Q09[c(1:11,22:32),55:169] All.Life.Forms - Q08.Q09[c(1:11,22:32),] Perennial.Forb.min-vegtab(Perennial.Forb, min=2) Perennial.Forb.std-decostand(Perennial.Forb.min, method=max) Perennial.Forb.dist- dist(Perennial.Forb.std) NMDS.Perennial.Forb -metaMDS(Perennial.Forb) Perennial.Forb.ward-hclust(Perennial.Forb.dist,method=ward,members=NULL) plot(Perennial.Forb.ward) plot(NMDS.Perennial.Forb, sites, main=Ordicluster overlaid on NMDS of Q 08-09 Perennial Forb) identify(plot( NMDS.Perennial.Forb,sites), sites) ordicluster(NMDS.Perennial.Forb, Perennial.Forb.ward) text(0.5,-.6,labels=Q 08-09, richness, Perennial Forb) shrub.min-vegtab(Shrub, min=2) shrub.std-decostand(shrub.min, method=max) shrub.dist- dist(shrub.std) NMDS.shrub -metaMDS(Shrub ) shrub.ward-hclust(shrub.dist,method=ward, members=NULL) plot(shrub.ward) plot(NMDS.shrub, sites, main=Ordicluster overlaid on NMDS of Q 08-09 Shrub) identify(plot( NMDS.shrub,sites), sites) ordicluster(NMDS.shrub , shrub .ward) text(-0.9,-.9, labels=Q 08-09,richness, Shrub) ACMA3 AMAL2 ARRI2 ARTR2 ARTR4 GRSPCHVI8 CRDO2 ERBL2 ERNA10 HODIKRLA2 MARE11 NEST5 PESIPIPOPOTR5 PREMPRVI PUTR2 RICEROWOSADOC SYAL2 SYOR2 WOODS SH ACHNA ACTH7 AGCRAGROS2 BROMU ELEL5 ELYMU FEIDFESTU LECI4 LUSP4 PG PHPR3 POA POBUPOCU3 POPRPOSEPSSP6 SCIRP HESPE11 BRHO2 BRTECARI2 VUOCVULPI AG ACMI2 AGGRALAC4 ALLIU ALSC2 ANDI2 ANFL2 ANMI3 ANST2 ANTEN AQFOARCUARHO2 ARSPARFR ARLUASSPASLE5 ASLYASPU9 ASRE6 ASTRA BACA3 BAHOBASA3 CA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 0 0 0 0 1 0 0 1 0 0 1 0
Re: [R-sig-eco] Unifrac distance matrix with dbRDA in Vegan
Hi Jari, Thanks. That's what i thought, but i was confused by this: I changed metaMDS function in vegan so that it easily accepts unifrac distances I thought it was something to do with formatting or a special unifrac output file or something. doug On 23 Apr 2012, at 12:36, Jari Oksanen wrote: On 23/04/2012, at 04:19 AM, dougwyu wrote: By the way, I changed metaMDS function in vegan so that it easily accepts unifrac distances a couple of years ago after I was in a workshop with Susan Letcher, and she suggested I do this. Cheers, Jari Oksanen Would you please point us to any documentation for importing unifrac distance matrices into vegan? (nothing specific about unifrac turns up in the vegan documentation) I was about to do this and was under the impression that i could treat unifrac matrices like any other distance matrix. Doug, It is not about vegan but about R: vegan uses R dissimilarity/distance structures (that inherit from class dist). Once you got it into R it is in vegan, and there is nothing specific to vegan. Cheers, Jari Oksanen -- Jari Oksanen, Dept Biology, Univ Oulu, 90014 Finland jari.oksa...@oulu.fi, Ph. +358 400 408593, http://cc.oulu.fi/~jarioksa ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology