search for: newenv

Displaying 5 results from an estimated 5 matches for "newenv".

2007 Mar 06
2
bug: sticky symbol refs? (PR#9555)
...is.null(x) } ############ # now create a fresh .RData and attach it at pos 2: > save(list = character(0), file = "/temp/.RData") # to create it > attach( "/temp/.RData", pos=2 ) # now source() /temp/myFuns.R in a local env, then copy new objs to search pos 2: > newEnv <- new.env() > eval(expression(source(file = "/temp/myFuns.R", local = T)), envir=newEnv) > for( objName in objects(envir = newEnv, all.names = T) ) { assign(objName, get(objName, envir = newEnv), pos = 2) } > f <- f # copy from pos 2 to workspace; (needed?) > g &...
2012 Jun 13
3
How to plot linear, cubic and quadratic fitting curve in a figure?
Hi R experts, Could you please help me to fit a linear, cubic and quadratic curve in a figure? I was trying to show all these three fitting curves with different colour in one figure. I spent substantial time to figure it out, but I could not. I have given here a example and what I did for linear, but no idea for cubic and quadratic fitting curve > dput(test) structure(list(sp = c(4L, 5L,
2008 Mar 07
3
merging environments
Despite the spirited arguments of various R-core folks who feel that mle() doesn't need a "data" argument, and that users would be better off learning to deal with function closures, I am *still* trying to make such things work in a reasonably smooth fashion ... Is there a standard idiom for "merging" environments? i.e., suppose a function has an environment that I want
2007 Oct 24
3
scoping problem
I would like to write a function that computes Tukey's 1 df for nonadditivity. Here is a simplified version of the function I'd like to write: (m is an object created by lm): tukey.test <- function(m) { m1 <- update(m, ~.+I(predict(m)^2)) summary(m1)$coef } The t-test for the added variable is Tukey's test. This won't work: data(BOD) m1 <- lm(demand~Time,BOD)
2009 Oct 01
2
creating environments in package's C code
Dear developers, is it possible to create environments in C code of packages? Simply using SEXP env; PROTECT (env = allocSExp(ENVSXP)); and assigning the enclosing environment with SET_ENCLOS seems to be insufficient. Best wishes, Martin -- Dr. Martin Becker Statistics and Econometrics Saarland University Campus C3 1, Room 206 66123 Saarbruecken Germany