Displaying 3 results from an estimated 3 matches for "myfnc".
Did you mean:
myfunc
2009 Mar 22
2
Following progress in a lapply() function
...ven better, reporting the percent of the list that have been process every 10%. However, I can't seem to figure out a way to achieve that.
For instance, I have a list of 50,000 slots:
aList <- replicate(50000,list(rnorm(50)))
That need to be process through the following custom function:
myFnc <- function(x){
tTest <- t.test(x)
return(list(p.value=tTest$p.value,t.stat=tTest$stat))
}
Using an lapply statement, as in:
myResults <- lapply(aList, myFnc)
The goal would be to report on the progress of the lapply() function during processing.
Any suggestion would be greatl...
2013 Jan 04
1
Garbage collection problem
...ot appear.
I run an algorithm that repeats the same calculation (on sampled, i.e.
different data) in each iteration. Each iteration uses relatively
large intermediate objects and calculations but returns a smaller
result; these results are then collated and returned from the main
function (call it myFnc). The problem is that memory used by the
intermediate calculations (it is difficult to say whether it's objects
or memory needed for apply calls) does not seem to be freed up even
after doing explicit garbage collection using gc() within the loop.
Thus, a call of something like
result = myFnc...
2013 Jan 04
0
Solved Re: Garbage collection problem
...repeats the same calculation (on sampled, i.e.
>> different data) in each iteration. Each iteration uses relatively
>> large intermediate objects and calculations but returns a smaller
>> result; these results are then collated and returned from the main
>> function (call it myFnc). The problem is that memory used by the
>> intermediate calculations (it is difficult to say whether it's objects
>> or memory needed for apply calls) does not seem to be freed up even
>> after doing explicit garbage collection using gc() within the loop.
>>
>> Th...