Block some operators for shinyoutput objects

This commit is contained in:
Winston Chang
2013-01-26 13:55:08 -06:00
parent 1848844be6
commit 6f0191e1cf
2 changed files with 23 additions and 1 deletions

View File

@@ -293,13 +293,31 @@ ShinyApp <- setRefClass(
#' @S3method $<- shinyoutput
`$<-.shinyoutput` <- function(x, name, value) {
x[['impl']]$defineOutput(name, value, deparse(substitute(value)))
.subset2(x, 'impl')$defineOutput(name, value, deparse(substitute(value)))
return(invisible(x))
}
#' @S3method [[<- shinyoutput
`[[<-.shinyoutput` <- `$<-.shinyoutput`
#' @S3method $ shinyoutput
`$.shinyoutput` <- function(x, name) {
stop("Reading objects from shinyoutput object not allowed.")
}
#' @S3method [[ shinyoutput
`[[.shinyoutput` <- `$.shinyoutput`
#' @S3method [ shinyoutput
`[.shinyoutput` <- function(values, name) {
stop("Single-bracket indexing of shinyoutput object is not allowed.")
}
#' @S3method [<- shinyoutput
`[<-.shinyoutput` <- function(values, name, value) {
stop("Single-bracket indexing of shinyoutput object is not allowed.")
}
resolve <- function(dir, relpath) {
abs.path <- file.path(dir, relpath)
if (!file.exists(abs.path))