Re: [R] Vegan(ordistep) error: Error in if (aod[1, 5] <= Pin) { : missing value where TRUE/FALSE needed
Nevil Amos gmail.com> writes: > > Whilst the constrained proportion was 0 in the example below I am getting the error in cases where this is not > so. See new output pasted below > Nevil, This still sounds like the same problem. I can't reproduce your problem, but I could construct a case which gives similar error messages, and fixed that problem. This is a bit like blind watchmaker's job, since I don't know what is your problem. However, go to http://vegan.r-forge.r-project.org/ and download and source() the latest version (rev2044) of ordistep.R and see if that works. In either case, report the results to me (outside the list) so that I know whether I managed to fix the problem or I have to find new blind ideas. Cheers, Jari Oksanen __ 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] Vegan(ordistep) error: Error in if (aod[1, 5] <= Pin) { : missing value where TRUE/FALSE needed
Whilst the constrained proportion was 0 in the example below I am getting the error in cases where this is not so. See new output pasted below [1] "ORDISTEP RDA1 BOTH WAYS" [1] "" [1] "SFW ALL Adult" [1] mds3dSFW_EO_100_CS25 mds3dSFW_EO_5000_CS25 mds3dSFW_TH_10_CS25 mds3dSFW_TH_2_CS25 Call: rda(formula = mygenind@tab ~ mds3dTRE_25_100_CS25 + mds3dTRE_25_10_CS25 + mds3dTRE_25_2_CS25 + mds3dTRE_25_5_CS25 + mydata$TreeCov + mydata$Hab_Config + mydata$Site_No + mydata$Landscape + mds3dCS_NULL + mydata$LAT.x + mydata$LONG.x, na.action = "na.omit") Inertia Proportion Rank Total 4.5099 1. Constrained1.2635 0.2802 29 Unconstrained 3.2464 0.7198 142 Inertia is variance Some constraints were aliased because they were collinear (redundant) Eigenvalues for constrained axes: RDA1 RDA2 RDA3 RDA4 RDA5 RDA6 RDA7 RDA8 RDA9RDA10RDA11 0.173325 0.126065 0.093396 0.086910 0.072219 0.063064 0.062034 0.058022 0.050743 0.045038 0.043567 RDA12RDA13RDA14RDA15RDA16RDA17RDA18RDA19 RDA20RDA21RDA22 0.039200 0.035363 0.033358 0.029372 0.028224 0.025715 0.024484 0.024007 0.021999 0.020480 0.018853 RDA23RDA24RDA25RDA26RDA27RDA28RDA29 0.017277 0.015510 0.015091 0.012845 0.011089 0.009377 0.006886 Eigenvalues for unconstrained axes: PC1PC2PC3PC4PC5PC6PC7PC8 0.2037 0.1710 0.1670 0.1450 0.1343 0.1155 0.1120 0.1015 (Showed only 8 of all 142 unconstrained eigenvalues) Error in if (aod[1, 5] <= Pin) { : missing value where TRUE/FALSE needed In addition: There were 50 or more warnings (use warnings() to see the first 50) > > > > traceback() 6: ordistep(myrda0, scope = formula(myrda1), direction = "both", Pin = 0.05, Pout = 0.1) at #55 5: eval(expr, envir, enclos) at #55 4: eval(expr, pf) at #55 3: withVisible(eval(expr, pf)) at #55 2: evalVis(expr) at #55 1: capture.output(ordistep(myrda0, scope = formula(myrda1), direction = "both", Pin = 0.05, Pout = 0.1)) at #55 Cheers Nevil Amos > > Nevil Amos monash.edu> writes: > >> >> I am getting the following erro rmessage in ordistep. I have a number of >> similarly structured datasets using ordistep in a loop, and the message >> only occurs for some of the datasets. >> >> I cannot include a reproducible sample - the specific datasets where this >> is occur ing are fairly large and there are several pcnm's in the rhs of >> the formula. >> >> Error in if (aod[1, 5] <= Pin) { : missing value where TRUE/FALSE needed >> > Nevil, > > It seems to me that the source of the problem appears in this table: > >> Inertia Proportion Rank >> Total 1.8110 1. >> Conditional0.8681 0.4793 32 >> Constrained0. 0.0 >> Unconstrained 0.9429 0.5207 29 >> Inertia is variance >> Some constraints were aliased because they were collinear (redundant) >> > > The key point is that "Constrained" component is completely alaised (Inertia > 0, > Rank 0) and therefore it cannot be analysed in permutation tests. You get the > same error message with this model: > > mod <- rda(dune ~ Moisture + Condition(Moisture), dune.env) > > and for the same reason. In your case, PCNM's seem to explain everything and > there is nothing left for other variables, and therefore you cannot analyse > them. > > Cheers, Jari Oksanen > > I can see how to fix this in vegan. All I can do is to handle these cases > smoothly and with comprehensible error messages, though. They cannot be > handled > with permutation tests since there is nothing to do if "Constrained" component > is zeroed. > > Cheers, Jari Oksanen [[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.
Re: [R] Vegan(ordistep) error: Error in if (aod[1, 5] <= Pin) { : missing value where TRUE/FALSE needed
Nevil Amos monash.edu> writes: > > I am getting the following erro rmessage in ordistep. I have a number of > similarly structured datasets using ordistep in a loop, and the message > only occurs for some of the datasets. > > I cannot include a reproducible sample - the specific datasets where this > is occur ing are fairly large and there are several pcnm's in the rhs of > the formula. > > Error in if (aod[1, 5] <= Pin) { : missing value where TRUE/FALSE needed > Nevil, It seems to me that the source of the problem appears in this table: > Inertia Proportion Rank > Total 1.8110 1. > Conditional0.8681 0.4793 32 > Constrained0. 0.0 > Unconstrained 0.9429 0.5207 29 > Inertia is variance > Some constraints were aliased because they were collinear (redundant) > The key point is that "Constrained" component is completely alaised (Inertia 0, Rank 0) and therefore it cannot be analysed in permutation tests. You get the same error message with this model: mod <- rda(dune ~ Moisture + Condition(Moisture), dune.env) and for the same reason. In your case, PCNM's seem to explain everything and there is nothing left for other variables, and therefore you cannot analyse them. Cheers, Jari Oksanen I can see how to fix this in vegan. All I can do is to handle these cases smoothly and with comprehensible error messages, though. They cannot be handled with permutation tests since there is nothing to do if "Constrained" component is zeroed. Cheers, Jari Oksanen __ 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] Vegan(ordistep) error: Error in if (aod[1, 5] <= Pin) { : missing value where TRUE/FALSE needed
I am getting the following erro rmessage in ordistep. I have a number of similarly structured datasets using ordistep in a loop, and the message only occurs for some of the datasets. I cannot include a reproducible sample - the specific datasets where this is occur ing are fairly large and there are several pcnm's in the rhs of the formula. thanks for any pointers that may allow me to track down the cause of the error. Error in if (aod[1, 5] <= Pin) { : missing value where TRUE/FALSE needed In addition: There were 50 or more warnings (use warnings() to see the first 50) traceback() 9: ordistep(myrda0, scope = formula(myrda1), direction = "both", Pin = 0.05, Pout = 0.1) at RDAPARTIALSexandAgeConnectandGEOGraphy2.R#86 8: eval(expr, envir, enclos) at RDAPARTIALSexandAgeConnectandGEOGraphy2.R#86 7: eval(expr, pf) at RDAPARTIALSexandAgeConnectandGEOGraphy2.R#86 6: withVisible(eval(expr, pf)) at RDAPARTIALSexandAgeConnectandGEOGraphy2.R#86 5: evalVis(expr) at RDAPARTIALSexandAgeConnectandGEOGraphy2.R#86 4: capture.output(ordistep(myrda0, scope = formula(myrda1), direction = "both", Pin = 0.05, Pout = 0.1)) at RDAPARTIALSexandAgeConnectandGEOGraphy2.R#86 3: eval.with.vis(expr, envir, enclos) 2: eval.with.vis(ei, envir) 1: source("~/Documents/Dropbox/thesis/CH3/Analysis/RDAPARTIALSexandAgeConnectandGEOGraphy2.R") print(myrda1) Call: rda(formula = mygenind@tab ~ pcnmTRE_25_100_CS25 + pcnmTRE_25_10_CS25 + pcnmTRE_25_2_CS25 + pcnmTRE_25_5_CS25 + mydata$TreeCov + mydata$Hab_Config + pcnmEYR_EO_100_CS25 + pcnmEYR_EO_5000_CS25 + pcnmEYR_TH_10_CS25 + pcnmEYR_TH_2_CS25 + mydata$Site_No + mydata$Landscape + Condition(pcnmCS_NULL + mydata$LAT.x + mydata$LONG.x), na.action = "na.omit") Inertia Proportion Rank Total 1.8110 1. Conditional0.8681 0.4793 32 Constrained0. 0.0 Unconstrained 0.9429 0.5207 29 Inertia is variance Some constraints were aliased because they were collinear (redundant) Eigenvalues for unconstrained axes: PC1 PC2 PC3 PC4 PC5 PC6 PC7 PC8 0.16008 0.14733 0.12183 0.09054 0.07380 0.06971 0.05578 0.04215 (Showed only 8 of all 29 unconstrained eigenvalues) -- Nevil Amos Molecular Ecology Research Group Australian Centre for Biodiversity Monash University CLAYTON VIC 3800 Australia [[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.