Re: [R] sys.frame() and variables from parent frame

2013-02-28 Thread José Miguel Delgado
On 02/27/2013 07:30 PM, David Winsemius wrote: > On Feb 27, 2013, at 10:16 AM, Bert Gunter wrote: > >> Some additional comments inline below to add to David's >> clarifications, proffered largely in response to the poster's remark >> about coming to R from another language. >> >> On Wed, Feb 27, 2

Re: [R] sys.frame() and variables from parent frame

2013-02-27 Thread Zé Miguel
Dear David, thanks for your reply. Sorry for the ambiguous example. I guess the get() will do it, but I still have a question regarding the parent frame. If I declare both function g and f in the global environment: g <- function() { get(N,envir = ???) write(N) } f<-function() { N<-99 g() } Wha

Re: [R] sys.frame() and variables from parent frame

2013-02-27 Thread David Winsemius
On Feb 27, 2013, at 10:16 AM, Bert Gunter wrote: > Some additional comments inline below to add to David's > clarifications, proffered largely in response to the poster's remark > about coming to R from another language. > > On Wed, Feb 27, 2013 at 9:44 AM, David Winsemius > wrote: >> >> On

Re: [R] sys.frame() and variables from parent frame

2013-02-27 Thread Bert Gunter
Some additional comments inline below to add to David's clarifications, proffered largely in response to the poster's remark about coming to R from another language. On Wed, Feb 27, 2013 at 9:44 AM, David Winsemius wrote: > > On Feb 27, 2013, at 1:11 AM, Zé Miguel wrote: > >> Dear David, >> >> t

Re: [R] sys.frame() and variables from parent frame

2013-02-27 Thread David Winsemius
On Feb 27, 2013, at 1:11 AM, Zé Miguel wrote: > Dear David, > > thanks for your reply. Sorry for the ambiguous example. I guess the get() > will do it, but I still have a question regarding the parent frame. If I > declare both function g and f in the global environment: > > g <- function() >

Re: [R] sys.frame() and variables from parent frame

2013-02-26 Thread David Winsemius
On Feb 26, 2013, at 2:40 AM, José Miguel Delgado wrote: > Dear R-help, > > I wrote the following lines in order to use a variable from a parent frame in > my callM() function. I would like to solve this by only editing the > callM(function). When I run this code I obtain a empty list, meaning

[R] sys.frame() and variables from parent frame

2013-02-26 Thread José Miguel Delgado
Dear R-help, I wrote the following lines in order to use a variable from a parent frame in my callM() function. I would like to solve this by only editing the callM(function). When I run this code I obtain a empty list, meaning that eval(ls(),sys.frame(-1)) could not access the variables in th