[R] mvr error in PLS package
Bjørn-Helge Mevik
bhs2 at mevik.net
Tue Nov 27 11:17:59 CET 2007
Gavin Simpson wrote:
> On Mon, 2007-11-26 at 09:25 -0800, Bricklemyer, Ross S wrote:
>>
>> > 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.
It would also be nice to know which version of the package you are
using. :-)
> 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.
Actually, as of version 2.0-0, mvr() etal should cope with factors
without problems. They will be coded just as in lm().
Another thing to try is to say traceback() just after receiving the
error message. That might tell you more about _where_ the error
occurred.
--
Bjørn-Helge Mevik
More information about the R-help
mailing list