[R] Ctree plot
HI everybody! Has anybody figure out how would be possible to plot several ctree plots beside each other? I would really appreciate it My idea would be like this, but the par() function seem to be lower in hierarchy Thanks in advance # library(party) mtree <- ctree(Species ~ ., data=iris) sep.tree<-ctree(Sepal.Length ~ ., data=iris) par(mfrow=c(1,2)) # Does not work plot(mtree) plot(sep.tree) - Rodrigo Vargas G. - Silviculture Institute Freiburg University -- View this message in context: http://r.789695.n4.nabble.com/Ctree-plot-tp4639750.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Envfit, inconsistant result?
Hi R-experts, I am using the envfit function over an ordination of floristic data. The problem is that every time that I run it changes the results. Sometimes dramatically, selecting variables that the first time were not significant. I do not get what could be the problem or if is normal given the permutations are different. # the NMDS ordination gap_flor_NMDS_chord <- metaMDS(gaps_flor, distance = "euclid", k = 2, trymax = 20, autotransform =TRUE, noshare = 0.1, wascores = TRUE, expand = TRUE, trace = 1, plot = FALSE, old.wa = FALSE, zerodist = "add") # the environmental variables to use with enfit explain1<- site[c("Tipo", "Gap.size", "Gap diameter (m)", "Size.cat", "altitud", "Slope (%)", "Exp.deg", "form","formcont", "largo_medio_gmak_m", "Dom.Hight", "d_m_gapmak_cm", "Cat_edad", "uprooted_perc", "Snapped gap maker (%)", "stand_dead_perc", "controlled_perc", "nodet_orig_gmkr_perc", "Total_borde", "PACL_diff_warm045", "rock", "musg_hep", "mantillo", "sm", "tronco_tot", "Time.ctr", "mf_gmk_perc", "fm_gmk", "dc_gmk_perc", "be_gmk_perc", "ach_gmk_perc", "nodet_spp_gmkr_perc", "Myrceugenia as border tree (%)", "Fm_borde.", "Dc_borde.", "Be_borde.", "Rv_borde.", "Aristotelia as border tree (%)")] # the Envfit calculation exp_flor1 <- envfit(gap_flor_NMDS_chord, explain1, permu = 999, na.rm=T) Thanks a lot for your help, comments and input! - Rodrigo Vargas G. - Silviculture Institute Freiburg University -- View this message in context: http://r.789695.n4.nabble.com/Envfit-inconsistant-result-tp3836585p3836585.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Envfit, inconsistant result?
Thanks a lot ! At the end I found that the problem was in the data input. Once I normilized the data input to use the chord distance as measure of dissimilarity gaps_flor_norm<-decostand(gaps_flor, "norm"), then I run the nMDS several times comparing them through procrustes plot(procrustes(gap_flor_NMDS1, gap_flor_NMDS2)) Can not say more, Thanks a lot for your response and all your work, Cheers, Rodrigo Vargas G. - Silviculture Institute Freiburg University +49 0761 203 8621 Tennenbacher str 4 Freiburg ibr 2011/9/28 Jari Oksanen [via R] > rodrock gmail.com> writes: > > > > I am using the envfit function over an ordination of floristic data. > > > > The problem is that every time that I run it changes the results. > Sometimes > > dramatically, selecting variables that the first time were not > significant. > > I do not get what could be the problem or if is normal given the > > permutations are different. > > > > # the NMDS ordination > > > > gap_flor_NMDS_chord <- metaMDS(gaps_flor, distance = "euclid", k = 2, > trymax > > = 20, autotransform =TRUE, > > noshare = 0.1, wascores = TRUE, expand = TRUE, trace = 1, > > plot = FALSE, old.wa = FALSE, zerodist = "add") > > > > > # the Envfit calculation > > exp_flor1 <- envfit(gap_flor_NMDS_chord, explain1, permu = 999, na.rm=T) > > > > > Rodrigo, > > Do you re-run your NMDS when the envfit results change? The results of NMDS > may > change between two runs. You should first check that the NMDS results are > nearly > identical. This you can do with procrustes() function in vegan: > > plot(procrustes(gap_flor_NMDS1, gap_flor_NMDS2)) > > where the arguments gap_flor_NMDS1 and gap_flor_NMDS2 are two NMDS results > that > gave you different envfit results. Use of plot() above helps you to avoid > looking at tiny differences in a numeric results: if you cannot see a > difference > in the procrustes plot, there is no difference you need to worry about. > Only > worry about envfit differences if the NMDS results are practically > identical. > > I'm surprised if metaMDS didn't issue any warning on the combination of > arguments you used in metaMDS: having no.share > 0 and distance = "euclid" > sounds dubious, and I have tried to catch those cases and issue an > informative > warning. You could also try higher trymax to get more consistent NMDS > results. > > Cheers, Jari Oksanen > > __ > [hidden email] <http://user/SendEmail.jtp?type=node&node=3850347&i=0>mailing > list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > > -- > If you reply to this email, your message will be added to the discussion > below: > > http://r.789695.n4.nabble.com/Envfit-inconsistant-result-tp3836585p3850347.html > To unsubscribe from Envfit, inconsistant result?, click > here<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3836585&code=cm9kcmlnby52YXJnYXNnYWV0ZUBnbWFpbC5jb218MzgzNjU4NXw5MTY2NDczMDU=>. > > - Rodrigo Vargas G. - Silviculture Institute Freiburg University -- View this message in context: http://r.789695.n4.nabble.com/Envfit-inconsistant-result-tp3836585p3859115.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Problem with factors in NMDS and Envfit
Hi everybody, thanks in advance for your help! I am working with genetic data performing an NMDS to visualize the genetic differentiation of individuals from different species and populations in different site conditions (site variables are all factors), and actually genetic data also. The data base is kind of big (> 1000 individuals x 551 variables) Nmds so far has not worked with the genetic data input as factors it shows me and error (maybe the distance is not the proper?) as integer the NMDS works well ord2<-metaMDS(gen_all_nonas,k = 2, distance="euclid", autotransform=F, noshare=T, na.rm=T) When I use envfit to see the correlation of the site factors it does not work until I remove all Nas. Once I do that it works almost good ("I can live" with the Nas removing) but somehow It show me an error considering the factor: Populations where the individuals come from ("Pop") exp_site<-envfit(ord2~Pop+Sp+Location+Soil+Water+Flooding+Ca, strata=Sp, na.rm=T)# with strata Error en `colnames<-`(`*tmp*`, value = "Pop") : attempt to set colnames on object with less than two dimensions I do not know what I am doing wrong, there are more than 40 Populations in the data set but I get this problem. Once I remove "Pop" from the command It works ok e.g., attach(site_all_nonas) exp_site2<-envfit(ord2~Sp+Location+Soil+Water+Flooding+Ca, strata=Sp, na.rm=T)# with strata Sp exp_site2 Goodness of fit: r2 Pr(>r) Sp 0.5398 0.001 *** Location 0.4174 0.001 *** Soil 0.0090 0.511 Water0.0103 0.873 Flooding 0.0234 0.515 Ca 0.0334 0.901 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 P values based on 999 permutations, stratified within strata. - Rodrigo Vargas G. - Silviculture Institute Freiburg University -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-factors-in-NMDS-and-Envfit-tp4623645.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.