Re: [R] referring to calls in functions

2009-01-13 Thread Charles C. Berry
On Tue, 13 Jan 2009, joseph.g.bo...@gsk.com wrote: The first program generates an error message and does not execute the regression of y on x. x<-1:10; y<-rnorm(10) + x; prac <- function( model, wghts ){ lm(model, weights = wghts) } prac(model = y~x, wghts = rep(1

[R] referring to calls in functions

2009-01-13 Thread joseph . g . boyer
The first program generates an error message and does not execute the regression of y on x. x<-1:10; y<-rnorm(10) + x; prac <- function( model, wghts ){ lm(model, weights = wghts) } prac(model = y~x, wghts = rep(1, 10)) But the next program works: x<