Gavin,
Yes, I thought I was responding to Berwin, whoops!
Since I'm often mixing different data frames, I rarely use this formulation:
gam(y ~ s(x), dat)
Actually, I often forget about that syntax, and it's a good reminder. It
really is much easier to read. In my "real" model that people actua
On Fri, 2011-05-06 at 11:20 -0500, Gene Leynes wrote:
> Hmmm
>
> After reading that email four times, I think I see what you mean.
>
> Checking for variables within particular scopes is probably one of the most
> challenging things in R, and I would guess in other languages too. In R
> it's
Hmmm
After reading that email four times, I think I see what you mean.
Checking for variables within particular scopes is probably one of the most
challenging things in R, and I would guess in other languages too. In R
it's compounded by situations when you're writing a function to accept
va
G'day Rolf,
On Fri, 06 May 2011 09:58:50 +1200
Rolf Turner wrote:
> but it's strange that the dodgey code throws an error with gam(dat1$y
> ~ s(dat1$x)) but not with gam(dat2$cf ~ s(dat2$s))
> Something a bit subtle is going on; it would be nice to be able to
> understand it.
Well,
R> trac
On 06/05/11 07:05, P Ehlers wrote:
Gene,
David has given you the preferred code. I just want to
point out that the $-accessor is often not the best
thing to use. Both dat[["y"]] and dat[, "y"] will work
just fine.
Admittedly one should use the preferred code, i.e. gam(y ~ s(x),data=dat)
and av
Gene,
David has given you the preferred code. I just want to
point out that the $-accessor is often not the best
thing to use. Both dat[["y"]] and dat[, "y"] will work
just fine.
Peter Ehlers
On 2011-05-05 12:06, David Winsemius wrote:
On May 5, 2011, at 1:08 PM, Gene Leynes wrote:
This is
On May 5, 2011, at 1:08 PM, Gene Leynes wrote:
This is not mission critical, but it's bothering me. I'm getting
inconsistent results when I use the $ accessor in the gam formula
*In window #1:*
library(mgcv)
dat=data.frame(x=1:100,y=sin(1:100/50)+rnorm(100,0,.05))
str(dat)
gam(dat$y~s(dat$x)
This is not mission critical, but it's bothering me. I'm getting
inconsistent results when I use the $ accessor in the gam formula
*In window #1:*
> library(mgcv)
> dat=data.frame(x=1:100,y=sin(1:100/50)+rnorm(100,0,.05))
> str(dat)
> gam(dat$y~s(dat$x))
Error in eval(expr, envir, enclos) : objec
8 matches
Mail list logo