Re: [R] Memory not release when an environment is created

2016-09-22 Thread peter dalgaard
> On 22 Sep 2016, at 21:24 , luke-tier...@uiowa.edu wrote: > > On Thu, 22 Sep 2016, luke-tier...@uiowa.edu wrote: > >> My preference is to use a top level function in the package or global >> env that takes as arguments just the variables I want in the parent >> frame. That avoids the explicit e

Re: [R] Memory not release when an environment is created

2016-09-22 Thread luke-tierney
On Thu, 22 Sep 2016, luke-tier...@uiowa.edu wrote: My preference is to use a top level function in the package or global env that takes as arguments just the variables I want in the parent frame. That avoids the explicit environment manipulations. Here that would be makeFunc0 <- function(xmin,

Re: [R] Memory not release when an environment is created

2016-09-22 Thread luke-tierney
My preference is to use a top level function in the package or global env that takes as arguments just the variables I want in the parent frame. That avoids the explicit environment manipulations. Here that would be makeFunc0 <- function(xmin, xmax) function(y) (y - xmin) / (xmax - xmin)

Re: [R] Memory not release when an environment is created

2016-09-22 Thread William Dunlap via R-help
I like to have my function-returning functions use new.env(parent=XXX) to make an environment for the returned function and put into it only the objects needed by the function. The 'XXX' should be a an environment which will hang around anyway. It could be globalenv(), but if your function is in

Re: [R] Memory not release when an environment is created

2016-09-22 Thread David Winsemius
> On Sep 22, 2016, at 9:45 AM, Ismail SEZEN wrote: > > >> On 22 Sep 2016, at 18:41, Olivier Merle wrote: >> >> Dear, >> >> When I use big data for a temporary use it seems that the memory is not >> released when a function/environement is created nearby. >> Here the reproducible exemple: >>

Re: [R] Memory not release when an environment is created

2016-09-22 Thread David Winsemius
> On Sep 22, 2016, at 8:41 AM, Olivier Merle wrote: > > Dear, > > When I use big data for a temporary use it seems that the memory is not > released when a function/environement is created nearby. > Here the reproducible exemple: > > test<-function(){ > x=matrix(0,5,1) > y=function(nb)

Re: [R] Memory not release when an environment is created

2016-09-22 Thread Ismail SEZEN
> On 22 Sep 2016, at 18:41, Olivier Merle wrote: > > Dear, > > When I use big data for a temporary use it seems that the memory is not > released when a function/environement is created nearby. > Here the reproducible exemple: > > test<-function(){ > x=matrix(0,5,1) > y=function(nb) nb