> it depends on what the original author wanted. > > with constructs a new environment, and all assignments, if any, made in > the expression evaluated within with are invisible to the outside > (unless one plays with environments, again): > > x = 1:10 > a = 3 > with(test(), { x[1:3] = c(a,b,c); x = x+d; a = a + 1 }) > x # still 1:10, whatever test returns > a # still 3. whatever test returns > > if the author wanted the values included in the list to be visible and > accessible by simple names, and used in assignments in a larger part of > code, using with might be inconvenient.
What about within ? Hadley -- http://had.co.nz/ ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.