On So, Feb 7, 2016 at 2:46 , Duncan Murdoch
wrote:
An assignment function should return the modified value. So it looks
like you would need
'getValue<-' <- function(x, value) {
environment(x)$mylist <- value
x
}
Thanks. I have not thought of a return value. That makes the differen
Dear all,
I have a function "fn" with its own environment, i.e.
env <- environment(fn)
and env is not .GlobalEnv. And another function
getValue <- function(x) environment(x)$mylist
which returns the list object "mylist" which is in "env". If I want to
modify "mylist", I could write
'getVal
Dear Martyn,
On Fr, Jan 15, 2016 at 4:01 , Martyn Plummer wrote:
Alternatively, you may be able to control the maximum number of
threads
by setting and exporting an appropriate environment variable depending
on what backend you are using, e.g. OPENBLAS_NUM_THREADS or
MKL_NUM_THREADS.
Tha
Dear all,
I run different R versions (3.2.1, 3.2.2 and 3.2.3) on different
platforms (Arch, Ubuntu, Debian) with a different number of available
cores (24, 4, 24). The following line produces very different behavior
on the three machines:
for(i in 1:1e6) {n <- 100; M <- matrix(rnorm(n^2), n,
> return(myfn)
> > })
> >
> > sapply(test, function(myfn) myfn(2))
> >
> >
> >
> > Cheers,
> > Daniel
> >
>
--
Daniel Kaschek
Institute of Physics
Freiburg University
Room 210
Phone: +49 761 2038531
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
this a
bug or a feature?
conditions <- 1:4
test <- lapply(conditions, function(mycondition){
#print(mycondition)
myfn <- function(i) mycondition*i
return(myfn)
})
sapply(test, function(myfn) myfn(2))
Cheers,
Daniel
--
Daniel Kaschek
Institute of Physics
Freiburg University
Room