> * Duncan Murdoch [2012-08-29 10:30:10 -0400]:
>
> On 29/08/2012 12:50 AM, Sam Steingold wrote:
>> > * Duncan Murdoch [2012-08-28 21:06:33 -0400]:
>> >
>> > On 12-08-28 5:55 PM, Sam Steingold wrote:
>> >>
>> >> my observation is that gc in R sucks.
>> >> (it cannot release small objects).
>> >>
On 29/08/2012 12:50 AM, Sam Steingold wrote:
> * Duncan Murdoch [2012-08-28 21:06:33 -0400]:
>
> On 12-08-28 5:55 PM, Sam Steingold wrote:
>>> * R. Michael Weylandt [2012-08-28 13:45:35
-0500]:
>>>
always you shouldn't need manual garbage collection.
>>
>> my observation is that gc in R s
> * Duncan Murdoch [2012-08-28 21:06:33 -0400]:
>
> On 12-08-28 5:55 PM, Sam Steingold wrote:
>>> * R. Michael Weylandt [2012-08-28 13:45:35
>>> -0500]:
>>>
always you shouldn't need manual garbage collection.
>>
>> my observation is that gc in R sucks.
>> (it cannot release small objects).
> * Jeff Newmiller [2012-08-28 15:21:39 -0700]:
>
> Sam Steingold wrote:
>
>>> * R. Michael Weylandt [2012-08-28
>>13:45:35 -0500]:
>>>
always you shouldn't need manual garbage collection.
>>
>>my observation is that gc in R sucks.
>>(it cannot release small objects).
>>this is not specific
> * R. Michael Weylandt [2012-08-28 17:30:06
> -0500]:
>
>> In my experience, the one point I've needed it was after freeing
>> multiple very large objects when hitting memory limits.
that's what I am doing.
>> Rewriting that code to use functions rather than as one long
>> imperative slog was
---
Jeff NewmillerThe . . Go Live...
DCN:Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Sola
On 12-08-28 5:55 PM, Sam Steingold wrote:
* R. Michael Weylandt [2012-08-28 13:45:35 -0500]:
always you shouldn't need manual garbage collection.
my observation is that gc in R sucks.
(it cannot release small objects).
this is not specific to R; ocaml suffers too.
Sorry, I didn't realize y
On Tue, Aug 28, 2012 at 5:13 PM, R. Michael Weylandt
wrote:
> On Tue, Aug 28, 2012 at 4:55 PM, Sam Steingold wrote:
>>> * R. Michael Weylandt [2012-08-28 13:45:35
>>> -0500]:
>>>
always you shouldn't need manual garbage collection.
>>
>> my observation is that gc in R sucks.
>> (it cannot
On Tue, Aug 28, 2012 at 4:55 PM, Sam Steingold wrote:
>> * R. Michael Weylandt [2012-08-28 13:45:35
>> -0500]:
>>
>>> always you shouldn't need manual garbage collection.
>
> my observation is that gc in R sucks.
> (it cannot release small objects).
> this is not specific to R; ocaml suffers too
> * R. Michael Weylandt [2012-08-28 13:45:35
> -0500]:
>
>> always you shouldn't need manual garbage collection.
my observation is that gc in R sucks.
(it cannot release small objects).
this is not specific to R; ocaml suffers too.
> since a loop doesn't define its own scope like some languages
On 28/08/2012 2:29 PM, Sam Steingold wrote:
At the end of a for loop its variables are still present:
for (i in 1:10) {
x <- vector(length=1)
}
ls()
will print "i" and "x".
this means that at the end of the for loop body I have to write
rm(x)
gc()
is there a more elegant way
On Aug 28, 2012, at 1:29 PM, Sam Steingold wrote:
> At the end of a for loop its variables are still present:
>
> for (i in 1:10) {
> x <- vector(length=1)
> }
> ls()
>
> will print "i" and "x".
> this means that at the end of the for loop body I have to write
>
> rm(x)
> gc()
>
>
On Tue, Aug 28, 2012 at 1:37 PM, R. Michael Weylandt
wrote:
> On Tue, Aug 28, 2012 at 1:29 PM, Sam Steingold wrote:
>> At the end of a for loop its variables are still present:
>>
>> for (i in 1:10) {
>> x <- vector(length=1)
>> }
>> ls()
>>
>> will print "i" and "x".
>> this means that
Perhaps I'm dense, but huh*?
-- Bert
*e.g. What are you trying to do? R does it's own garbage collection --
why do you think you need it?
And, as a general comment which may or may not be applicable, if you
create variables in a function they are local only to the function --
they disappear once t
Hello,
Maybe local().
Continue your example with
#?local
local(for (i in 1:10) {
x <- vector(length=1)
})
ls() # not 'i' nor 'x'
Hope this helps,
Rui Barradas
Em 28-08-2012 19:29, Sam Steingold escreveu:
At the end of a for loop its variables are still present:
for (i in 1:10) {
On Tue, Aug 28, 2012 at 1:29 PM, Sam Steingold wrote:
> At the end of a for loop its variables are still present:
>
> for (i in 1:10) {
> x <- vector(length=1)
> }
> ls()
>
> will print "i" and "x".
> this means that at the end of the for loop body I have to write
>
> rm(x)
> gc()
>
This is R, not S-Plus.
In the first two lines you have
expr <- as.expression(substitute(fun))
nvals <- length(eval(expr, envir = as.list(meanval)))
Simplified example:
y <- 0
fn1 <- function(){
y <- 1
fn1sub <- function() print(y)
fn1sub()
}
fn2sub <- function() print(y)
fn2 <- fun
adad gmx.at> writes:
> Working example:
> --
> library("emdbook")
>
> fn <- function()
> {
> browser()
> y <- 2
> print(deltavar(y*b2, meanval=c(b2=3), Sigma=1) )
> }
>
> x <- 2
> print(deltavar(x*b1, meanval=c(b1=3), Sigma=1) )
> y<-3
>
> fn()
>
>
Noah Silverman wrote:
>
>
> I have several "global" variables that I want to change with a given
> function. (The variable has a different value after the function is
> called.)
>
>
Berend Hasselman wrote:
>
>
> Maybe this helps
>
> ?`<<-`
>
It helps to get the job done, but the OP aske
On Mon, Jul 25, 2011 at 4:14 AM, Noah Silverman wrote:
> Hi,
>
> I'm working on coding some more complex things in R and have need to break
> much of the logic into functions.
>
> I have several "global" variables that I want to change with a given
> function. (The variable has a different valu
Hi Noah,
you could assign your "global variables" into an environment. Then make it
the environment of your function, and use the `<<-` operator (or 'assign').
An example:
> myData <- new.env()
> myData$i <- 0
> iPlusOne <- function() i <<- i+1
> environment(iPlusOne) <- myData
> ls()
[1] "iPlu
Noah Silverman wrote:
>
> Hi,
>
> I'm working on coding some more complex things in R and have need to break
> much of the logic into functions.
>
> I have several "global" variables that I want to change with a given
> function. (The variable has a different value after the function is
> call
On 1/2/08, John Fox <[EMAIL PROTECTED]> wrote:
> Dear Stefan,
>
> I don't think that your question was answered.
>
> If you invoke the formula method for splom(), then your function works; that
> is, you can use
>
> splom(~as.data.frame(rbind(data, outliers)), . . . .
>
> It looks to me as
Dear Stefan,
I don't think that your question was answered.
If you invoke the formula method for splom(), then your function works; that
is, you can use
splom(~as.data.frame(rbind(data, outliers)), . . . .
It looks to me as if this is a scoping problem produced by the way in which
splom
24 matches
Mail list logo