Dear friends, what is this error message in gam???? I cannot understand what it means .... is it a bug? gam_bray_scot24_pc_0505<gam(bray~s(PC1,PC2,PC3,PC4,PC5, PC1.1,PC2.1,PC3.1,PC4.1,PC5.1),data=dist_scot24_vector_with_climate) Error in if (length(data) != vl) { : missing value where TRUE/FALSE needed Calls: gam ... smooth.construct -> smooth.construct.tp.smooth.spec -> array In addition: Warning message: In array(0, n * k) : NAs introduced by coercion Execution halted Thanks in advance, Best regards -- Corrado Topi Global Climate Change & Biodiversity Indicators Area 18,Department of Biology University of York, York, YO10 5YW, UK Phone: + 44 (0) 1904 328645, E-mail: ct529 at york.ac.uk
David Winsemius
2009-Sep-01 14:00 UTC
[R] Strange error returned or bug in gam in mgcv????
On Sep 1, 2009, at 9:51 AM, Corrado wrote:> Dear friends, > > what is this error message in gam???? I cannot understand what it > means .... > is it a bug? > > gam_bray_scot24_pc_0505<gam(bray~s(PC1,PC2,PC3,PC4,PC5, > PC1.1,PC2.1,PC3.1,PC4.1,PC5.1),data=dist_scot24_vector_with_climate)If the code was as posted, you have entered "<" where you probably wanted "<-".> > Error in if (length(data) != vl) { : > missing value where TRUE/FALSE needed > Calls: gam ... smooth.construct -> smooth.construct.tp.smooth.spec - > > array > In addition: Warning message: > In array(0, n * k) : NAs introduced by coercion > Execution halted > > Thanks in advance, > > Best regards > -- > Corrado Topi > > Global Climate Change & Biodiversity Indicators > Area 18,Department of Biology > University of York, York, YO10 5YW, UK > Phone: + 44 (0) 1904 328645, E-mail: ct529 at york.ac.uk > > ______________________________________________ > R-help at 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.David Winsemius, MD Heritage Laboratories West Hartford, CT
Nope!!!! Of course, it was just a copy and paste problem .... On Tuesday 01 September 2009 15:00:34 David Winsemius wrote:> On Sep 1, 2009, at 9:51 AM, Corrado wrote: > > Dear friends, > > > > what is this error message in gam???? I cannot understand what it > > means .... > > is it a bug? > > > > gam_bray_scot24_pc_0505<gam(bray~s(PC1,PC2,PC3,PC4,PC5, > > PC1.1,PC2.1,PC3.1,PC4.1,PC5.1),data=dist_scot24_vector_with_climate) > > If the code was as posted, you have entered "<" where you probably > wanted "<-". > > > Error in if (length(data) != vl) { : > > missing value where TRUE/FALSE needed > > Calls: gam ... smooth.construct -> smooth.construct.tp.smooth.spec - > > > > > array > > > > In addition: Warning message: > > In array(0, n * k) : NAs introduced by coercion > > Execution halted > > > > Thanks in advance, > > > > Best regards > > -- > > Corrado Topi > > > > Global Climate Change & Biodiversity Indicators > > Area 18,Department of Biology > > University of York, York, YO10 5YW, UK > > Phone: + 44 (0) 1904 328645, E-mail: ct529 at york.ac.uk > > > > ______________________________________________ > > R-help at 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. > > David Winsemius, MD > Heritage Laboratories > West Hartford, CT-- Corrado Topi Global Climate Change & Biodiversity Indicators Area 18,Department of Biology University of York, York, YO10 5YW, UK Phone: + 44 (0) 1904 328645, E-mail: ct529 at york.ac.uk
The basic problem is that you have requested a 10 dimensional thin plate spline, with a basis dimension of 196830. In reality it will not be possible to compute this, even if you have more than 196830 data. In any case it would be unlikely to provide a very useful model --- the "simplest" function that it can theoretically represent will have 3003 degrees of freedom. That said the error message is obviously rather unhelpful... Can you tell me how many data you are actually trying to fit, and I'll try and track down exactly where it's failing, and put in a more informative message. best, Simon On Tuesday 01 September 2009 14:51, Corrado wrote:> Dear friends, > > what is this error message in gam???? I cannot understand what it means > .... is it a bug? > > gam_bray_scot24_pc_0505<gam(bray~s(PC1,PC2,PC3,PC4,PC5, > PC1.1,PC2.1,PC3.1,PC4.1,PC5.1),data=dist_scot24_vector_with_climate) > > Error in if (length(data) != vl) { : > missing value where TRUE/FALSE needed > Calls: gam ... smooth.construct -> smooth.construct.tp.smooth.spec -> array > In addition: Warning message: > In array(0, n * k) : NAs introduced by coercion > Execution halted > > Thanks in advance, > > Best regards--> Simon Wood, Mathematical Sciences, University of Bath, Bath, BA2 7AY UK > +44 1225 386603 www.maths.bath.ac.uk/~sw283
Seemingly Similar Threads
- Error "singular gradient matrix at initial parameter estimates" in nls
- A point in a vector?
- goodness of "prediction" using a model (lm, glm, gam, brt, regression tree .... )
- Concave hull
- From THE R BOOK -> Warning: In eval(expr, envir, enclos) : non-integer #successes in a binomial glm!