[R] Error in eval(expr, envir, enclos) : numeric envir arg not of length one

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Feb 17 09:09:04 CET 2005


On Thu, 17 Feb 2005, Stephen Choularton wrote:

> I am working with a largish dataset of 25k lines and I am now tying to
> use predict.
>
> pred = predict(cuDataGlmModel, length + meanPitch + minimumPitch +
> maximumPitch + meanF1 + meanF2 + meanF3 +  meanF4 +  meanF5 +
> ratioF1ToF2 + rationF3ToF1  +  jitter + shimmer + percentUnvoicedFrames
> + numberOfVoiceBreaks + percentOfVoiceBreaks + meanIntensity +
> minimumIntensity + maximumIntensity + ratioIntensity + noSyllsIntensity
> + startSpeech + syllables)
>
> I keep on getting this error message
>
> Error in eval(expr, envir, enclos) : numeric envir arg not of length one
>
> To be quite frank I am at a bit of a loss to know where to start looking
> to solve the problem.

`To be quite frank' so are we!  You have not told us the class of model, 
or where you got the idea than its predict method has a sum (not a 
formula) as second argument, nor given us code to reproduce this nor used 
traceback().

Some reading of the help page for the predict() method was suggested by 
the posting guide, and at a guess, try ?predict.glm.

Most predict() methods require a data frame as their second argument.

One might also question the inconsistency of `ratioF1ToF2 + rationF3ToF1'.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list