据推测,您可以加载R2WinBUGS
以访问该功能。
但是,一般来说,如果有看不到代码的功能,请尝试getAnywhere
.
例如,getAnywhere(replaceScientificNotationR)
产生:
A single object matching ‘replaceScientificNotationR’ was found
It was found in the following places
namespace:R2WinBUGS
with value
function (bmodel, digits = 5)
{
env <- new.env()
assign("rSNRidCounter", 0, envir = env)
replaceID <- function(bmodel, env, digits = 5) {
for (i in seq_along(bmodel)) {
if (length(bmodel[[i]]) == 1) {
if (as.character(bmodel[[i]]) %in% c(":", "[",
"[["))
return(bmodel)
if ((typeof(bmodel[[i]]) %in% c("double", "integer")) &&
((abs(bmodel[[i]]) < 0.001) || (abs(bmodel[[i]]) >
10000))) {
counter <- get("rSNRidCounter", envir = env) +
1
assign("rSNRidCounter", counter, envir = env)
id <- paste("rSNRid", counter, sep = "")
assign(id, formatC(bmodel[[i]], digits = digits,
format = "E"), envir = env)
bmodel[[i]] <- id
}
}
else {
bmodel[[i]] <- replaceID(bmodel[[i]], env, digits = digits)
}
}
bmodel
}
bmodel <- deparse(replaceID(bmodel, env, digits = digits),
control = NULL)
for (i in ls(env)) {
bmodel <- gsub(paste("\"", i, "\"", sep = ""), get(i,
envir = env), bmodel, fixed = TRUE)
}
bmodel
}
<environment: namespace:R2WinBUGS>
因此,它是 R2WinBUGS 包中的一个内部函数。或者,您可以从 CRAN 下载包源并进行探索。