https://github.com/cran/fOptions
Tip revision: 09a16d4365605c86100bf01684a3304933dfbdd8 authored by Yohan Chalabi on 23 June 2013, 00:00:00 UTC
version 3010.83
version 3010.83
Tip revision: 09a16d4
fOptionsEnv.R
.fOptionsEnv <- new.env(hash = TRUE)
.setfOptionsEnv <-
function(...)
{
x <- list(...)
nm <- names(x)
if (is.null(nm) || "" %in% nm)
stop("all arguments must be named")
sapply(nm, function(nm) assign(nm, x[[nm]],
envir = .fOptionsEnv))
invisible()
}
.getfOptionsEnv <-
function(x = NULL, unset = "")
{
if (is.null(x))
x <- ls(all.names = TRUE, envir = .fOptionsEnv)
### unlist(mget(x, envir = .fOptionsEnv, mode = "any",
### ifnotfound = as.list(unset)), recursive = FALSE)
get(x, envir = .fOptionsEnv, mode = "any")
}