Wacek Kusnierczyk wrote:
Peter Dalgaard wrote:
One distinction is if you have things like
#define f(x) 2*x
#define g(y) f(y+2)
(in the C language preprocessor syntax), then you end up with g(y) as
y+2*2 (i.e., y+4), whereas the corresponding function calls give
2*(y+2). Also, and the flip side
Peter Dalgaard wrote:
>
> One distinction is if you have things like
>
> #define f(x) 2*x
> #define g(y) f(y+2)
>
> (in the C language preprocessor syntax), then you end up with g(y) as
> y+2*2 (i.e., y+4), whereas the corresponding function calls give
> 2*(y+2). Also, and the flip side of the orig
joseph.g.boyer wrote:
>
> Thomas, Jeff, Mark, Antonio,
>
> Thank you for your answers. They have helped me clarify how R functions
> work. They work differently from SAS functions (which SAS calls macros.)
>
> To me, while the coding is quite awkward, the execution is logical. The
> variabl
Nordlund, Dan (DSHS/RDA) wrote:
-Original Message-
From: r-help-boun...@r-project.org
[mailto:r-help-boun...@r-project.org] On Behalf Of
joseph.g.bo...@gsk.com
Sent: Friday, December 19, 2008 7:41 AM
To: Thomas Lumley
Cc: r-help@r-project.org
Subject: Re: [R] understanding lexical
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of
> joseph.g.bo...@gsk.com
> Sent: Friday, December 19, 2008 7:41 AM
> To: Thomas Lumley
> Cc: r-help@r-project.org
> Subject: Re: [R] understanding l
Thomas, Jeff, Mark, Antonio,
Thank you for your answers. They have helped me clarify how R functions
work. They work differently from SAS functions (which SAS calls macros.)
If you know SAS, consider the following code:
*
%macro q(y);
data one;
outvar = &y. + &x.; output;
c
On Thu, 18 Dec 2008 joseph.g.bo...@gsk.com wrote:
I am trying to understand the concept of lexical scope in "An Introduction
to R" by the R Core development team.
I'd appreciate it if someone would explain why the following example does
not work:
q <- function(y) {x + y}; w <- function(x){q(x)
2008/12/18 :
> I am trying to understand the concept of lexical scope in "An Introduction
> to R" by the R Core development team.
>
> I'd appreciate it if someone would explain why the following example does
> not work:
>
> q <- function(y) {x + y}; w <- function(x){q(x)}; w(2);
>
> According to t
I am trying to understand the concept of lexical scope in "An Introduction
to R" by the R Core development team.
I'd appreciate it if someone would explain why the following example does
not work:
q <- function(y) {x + y}; w <- function(x){q(x)}; w(2);
According to the discussion of Scope on p
9 matches
Mail list logo