[Rd] how to start local scope?

From: Tamas K Papp <tpapp_at_princeton.edu>
Date: Thu 27 Jul 2006 - 12:16:13 GMT


How can I start a local scope inside an R function? Eg in

> b

Error: object "b" not found
> f <- function() {

+   {
+     b <- 1
+   }
+   b+2
+ }

> f()

[1] 3

I would like f() to report an error, not finding b. I am thinking about something like let in Scheme/Lisp.

Thanks,

Tamas



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Jul 27 22:20:22 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 27 Jul 2006 - 14:28:00 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.