Re: [R] variable scope for deltavar function from emdbook

2011-10-13 Thread Uwe Ligges
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

Re: [R] variable scope for deltavar function from emdbook

2011-10-11 Thread Ben Bolker
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() > >

[R] variable scope for deltavar function from emdbook

2011-10-10 Thread adad
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) )