Re: [R] Repost: Expressions returned by GlobalEnv functions and package functions

2012-05-31 Thread Oliver Ruebenacker
Hello Saptarshi, If two functions behave differently even though their definitions are identical, then it is because they refer to variables that were in scope when the functions were defined (i.e. lexical scoping). To prevent such differences, either define both functions in the same scope

[R] Repost: Expressions returned by GlobalEnv functions and package functions

2012-05-31 Thread Saptarshi Guha
Hello, (Sorry for the repost, i am resending in plain text) I have a function 'ewrap' (see below for definition). It takes 3 expressions and returns another expression e.g. map <- ewrap({ len <- length(r$addon) rhcollect(len,1) }) becomes: expression({ NULL result <- mapply(fu