See ?force
a <- function(z) {
force(k)
function() z+k
}
On 2/16/07, Ross Boylan <[EMAIL PROTECTED]> wrote:
> I would like to define a function using symbols, but freeze the symbols
> at their current values at the time of definition. Both symbols
> referring to the global scope
The R Language manual, section 4.3.4 ("Scope"), has
f <- function(x) {
y <- 10
g <- function(x) x + y
return(g)
}
h <- f()
h(3)
... When `h(3)' is evaluated we see that its body is that of `g'.
Within that body `x' and `y' are unbound.
Is that last
I would like to define a function using symbols, but freeze the symbols
at their current values at the time of definition. Both symbols
referring to the global scope and symbols referring to arguments are at
issue. Consider this (R 2.4.0):
> k1 <- 5
> k
[1] 100
> a <- function(z) function() z+k
>
Sooner or later we are going to have to require iconv for fully functional
R installations.
The only systems we are aware of that do not come with a suitable iconv
(with support for Unicode charsets like UTF-8) are some older commercial
Unixen, and GNU libiconv works on those we know of.
Does
I mentioned this twice already and no one answered;however, I am mentioning
this a third time since its a serious deficiency. The Rscript facility
that is upcoming in R is useful but on Windows one will often be relegated
to having two files: a batch file and an R file unless the -x switch
is imp