[R] mvr error in PLS package

Gavin Simpson gavin.simpson at ucl.ac.uk
Mon Nov 26 19:13:54 CET 2007


On Mon, 2007-11-26 at 09:25 -0800, Bricklemyer, Ross S wrote:
> All,
> 
> I have been using a data set to build pls models for three different
> soil properties.  Two of the three models run fine; however I receive
> the following error for the final model.  
> 
> > libs.IC.cal <- mvr(libs.IC.fmla, data = libsdata.cond.cal,
> ncomp=20,validation = "LOO", method = "oscorespls") 
> 
> Error in colMeans(x, n, prod(dn), na.rm) : 
>         'x' must be numeric
> 
> There are many "0" for this soil property.  Could this cause the
> error?

Without having the data (or a small example therefore) it is impossible
to tell.

To start, try str(libsdata.cond.cal) and check that the variables
referenced in your formula object (which is what I presume libs.IC.fmla
is?) are all numeric and haven't got coded as factors or characters or
something strange.

G

> 
> Best,
> Ross
> 
> *******************************************************************
> Ross Bricklemyer
> Dept. of Crop and Soil Sciences
> Washington State University
> 291D Johnson Hall
> PO Box 646420
> Pullman, WA 99164-6420
> Work: 509.335.3661
> Cell/Home: 406.570.8576
> Fax: 509.335.8674
> Email: rsb at wsu.edu
> 
>  
> 
> ______________________________________________
> 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.
-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-help mailing list