Re: [R] working with eval and environments

2010-09-20 Thread Duncan Murdoch
darckeen wrote: I'm trying to get the following section of code to work, I think the problem is being caused by the assignment of data to the lm function not evaluating to "train" in the parent environment but I can't seem to figure out how to do this. I'd suggest simplifying this. Packing

Re: [R] working with eval and environments

2010-09-19 Thread Michael Bedward
Hello, Not sure if I understand your question correctly, but you if you want to assign a value to an object called train in the parent environment you can do this in your function... train <<- some.data Michael On 20 September 2010 01:10, darckeen wrote: > > I'm trying to get the following sec

[R] working with eval and environments

2010-09-19 Thread darckeen
I'm trying to get the following section of code to work, I think the problem is being caused by the assignment of data to the lm function not evaluating to "train" in the parent environment but I can't seem to figure out how to do this. fitmodel <- function(trial,data) { wrap.lm <-