a better way to check which context the render function is being called from

This commit is contained in:
Barbara Borges Ribeiro
2016-03-28 12:54:54 +01:00
parent 03685dbb61
commit 80e1edeeb2
2 changed files with 24 additions and 12 deletions

View File

@@ -49,16 +49,6 @@ renderPlot <- function(expr, width='auto', height='auto', res=72, ...,
env=parent.frame(), quoted=FALSE,
execOnResize=FALSE, outputArgs=list()
) {
## This will only work under "normal" circumstances...
if (identical(parent.env(env), globalenv())) {
if (length(outputArgs) != 0){
warning("Unused argument: outputArgs. The argument outputArgs is only ",
"meant to be used when embedding snippets of Shiny code in an ",
"R Markdown code chunk (using runtime: shiny). When running a ",
"full Shiny app, please set the output arguments directly in ",
"the plotOutput() function in your UI code.")
}
}
# This ..stacktraceon is matched by a ..stacktraceoff.. when plotFunc
# is called
installExprFunction(expr, "func", env, quoted, ..stacktraceon = TRUE)