Re: [R] Question on passing the subset argument to an lm wrapper

2010-10-25 Thread Charles C. Berry
On Sun, 24 Oct 2010, Erik Iverson wrote: Hello, How would you go about handling the following situation? This is on R 2.12.0 on Ubuntu 32-bit. I have a wrapper function to lm. I want to pass in a subset argument. First, I just thought I'd use The subset arg needs to be unevaluated

Re: [R] Question on passing the subset argument to an lm wrapper

2010-10-25 Thread Henrique Dallazuanna
As workaround you can try this: testlm - function(formula, ...) { args - list(formula, data = df1, ...) do.call(lm, args) } testlm(bmi ~ age, subset = df1$age 50) On Mon, Oct 25, 2010 at 2:16 AM, Erik Iverson er...@ccbr.umn.edu wrote: Hello, How would you go about handling the

[R] Question on passing the subset argument to an lm wrapper

2010-10-24 Thread Erik Iverson
Hello, How would you go about handling the following situation? This is on R 2.12.0 on Ubuntu 32-bit. I have a wrapper function to lm. I want to pass in a subset argument. First, I just thought I'd use ## make example reproducible set.seed(123) df1 - data.frame(age = rnorm(100, 50, 10),