[R] Error in plot.lm
Jeff Newmiller
jdnewmil at dcn.davis.ca.us
Fri Mar 11 20:06:28 CET 2011
I am encountering an error with plot.lm:
> tstdf <- data.frame( y=c(1.01,1.98,3.02,3.99),x=c(1,2,3,4))
> plot(lm(I(y) ~ x, data=tstdf))
Hit <Return> to see next plot:
Hit <Return> to see next plot:
Error in object$coefficients : $ operator is invalid for atomic vectors
Obviously I don't need the I() in this example, but I have been working
with regressions that involve an expression on the left side of the
formula, for which I do need the I(). I can work around by declaring a
new actual column with the computed result, but this seems otherwise
unnecessary.
Is this behaviour intended?
> R.Version()
$platform
[1] "i386-pc-mingw32"
$arch
[1] "i386"
$os
[1] "mingw32"
$system
[1] "i386, mingw32"
$status
[1] ""
$major
[1] "2"
$minor
[1] "12.1"
$year
[1] "2010"
$month
[1] "12"
$day
[1] "16"
$`svn rev`
[1] "53855"
$language
[1] "R"
$version.string
[1] "R version 2.12.1 (2010-12-16)"
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
More information about the R-help
mailing list