diff --git a/R/shiny.R b/R/shiny.R index 64a296d20..5666eea76 100644 --- a/R/shiny.R +++ b/R/shiny.R @@ -145,16 +145,16 @@ start.app <- function(app, www.root, sys.www.root=NULL, port=8101L) { shinyapp$session$mset(msg$data) flush.react() local({ - define.shiny.output <- function(name, func) { + define.output <- function(name, func) { shinyapp$define.output(name, func) } - define.shiny.plot <- function(name, func, ...) { + define.plot <- function(name, func, ...) { shinyapp$define.plot.output(name, func, ...) } - define.shiny.table <- function(name, func, ...) { + define.table <- function(name, func, ...) { shinyapp$define.table.output(name, func, ...) } - get.shiny.input <- function(name) { + get.input <- function(name) { shinyapp$session$get(name) } diff --git a/examples/02_hash/app.R b/examples/02_hash/app.R index 939badf9f..67ace2b47 100644 --- a/examples/02_hash/app.R +++ b/examples/02_hash/app.R @@ -1,15 +1,15 @@ library(digest) input <- Observable$new(function() { - str <- get.shiny.input('input1') - if (get.shiny.input('addnewline')) + str <- get.input('input1') + if (get.input('addnewline')) str <- paste(str, "\n", sep='') return(str) }) -define.shiny.output('md5_hash', function() { +define.output('md5_hash', function() { digest(input$get.value(), algo='md5', serialize=F) }) -define.shiny.output('sha1_hash', function() { +define.output('sha1_hash', function() { digest(input$get.value(), algo='sha1', serialize=F) }) \ No newline at end of file diff --git a/examples/03_distributions/app.R b/examples/03_distributions/app.R index 7b3349d27..7d73d0f41 100644 --- a/examples/03_distributions/app.R +++ b/examples/03_distributions/app.R @@ -1,6 +1,6 @@ data <- Observable$new(function() { # Choose a distribution function - dist <- switch(get.shiny.input('dist'), + dist <- switch(get.input('dist'), norm = rnorm, unif = runif, lnorm = rlnorm, @@ -8,21 +8,21 @@ data <- Observable$new(function() { rnorm) # Generate n values from the distribution function - dist(max(1, get.shiny.input('n'))) + dist(max(1, get.input('n'))) }) -define.shiny.plot('plot1', function() { - dist <- get.shiny.input('dist') - n <- get.shiny.input('n') +define.plot('plot1', function() { + dist <- get.input('dist') + n <- get.input('n') hist(data$get.value(), main=paste('r', dist, '(', n, ')', sep='')) }, width=600, height=300) -define.shiny.table('table1', function() { +define.table('table1', function() { data.frame(x=data$get.value()) }) -define.shiny.output('summary1', function() { +define.output('summary1', function() { paste(capture.output(print(summary(data$get.value()))), collapse="\n") }) \ No newline at end of file diff --git a/examples/03_distributions/www/index.html b/examples/03_distributions/www/index.html index 31eca0480..32dc36142 100644 --- a/examples/03_distributions/www/index.html +++ b/examples/03_distributions/www/index.html @@ -22,10 +22,10 @@
-