> * 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()
>
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 to handle this?
Thanks.
--
Sam Steingold (http
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()
>
>
Dear all,
I want to use the deltavar() function from emdbook. I can use it
directly from the command terminal but within a function it behaves weird.
Working example:
--
library("emdbook")
fn <- function()
{
browser()
y <- 2
print(deltavar(y*b2, meanval=c(b2=3), Sigma=1) )
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
-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] Im Auftrag von Noah Silverman
> Gesendet: Sonntag, 24. Juli 2011 18:14
> An: r-help@r-project.org
> Betreff: [R] Variable scope in functions - best practices
>
> Hi,
>
> I'm working on coding some more com
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 called.)
In other languages like C, this is
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
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 called.)
In other languages like C, this is
I have a question on scope/reference/value type of variables with 'R'.
The issue cam up first when I look at the arima code.
I see code like:
myupARIMA <- function(mod, phi, theta) {
. . . .
mod
}
Then
armafn <- function(p, trans) {
. . . .
Z <- upAR
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
ECTED]
> project.org] On Behalf Of Stefan Eichenberger
> Sent: January-01-08 6:50 AM
> To: r-help@r-project.org
> Subject: [R] Variable scope R 2.6.1
>
>
> I have the following procedure which worked just fine for in R 2.2.0.
> Recently I upgraded to 2.6.1 and now ge
I have the following procedure which worked just fine for in R 2.2.0.
Recently I upgraded to 2.6.1 and now get an error:
> ScatterOutlier(pass_500_506[1:1000,6:12], marginal_500_506[,6:12])
Error in eval(expr, envir, enclos) : object "out" not found
Note that I use the same workspace (and h
30 matches
Mail list logo