This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
options(repos=c(CRAN="http://cran.rstudio.com")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
shinyServer(function(input, output) { | |
output$plot1 <- reactivePlot(function() { | |
plot(cars) | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shinyServer(function(input, output) { | |
output$currentTime <- reactiveText(function() { | |
# Forces invalidation in 1000 milliseconds | |
invalidateLater(1000) | |
as.character(Sys.time()) | |
}) | |
randomData <- reactive(function() { | |
if (!input$pause) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shinyServer(function(input, output) { | |
output$filetable <- reactiveTable(function() { | |
if (is.null(input$files)) { | |
# User has not uploaded a file yet | |
return(NULL) | |
} | |
input$files | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Nothing to see here | |
shinyServer(function(input, output) { | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# global.R | |
dists <- list( | |
normal = list( | |
label = "Normal", | |
func = rnorm, | |
inputs = tagList( | |
sliderInput("mean", "mean: ", min=0, max=400, value=0), | |
sliderInput("sd", "st. dev.: ", min=0.1, max=20, value=1, step=.1) | |
), | |
params = c("mean", "sd") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
shinyServer(function(input, output) { | |
re <- reactive(function(){ | |
cat("re called\n",file=stderr()) | |
input$n | |
}) | |
output$ntext <- reactiveText(function() { | |
cat("output$ntext called\n",file=stderr()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Some pre-computed stuff in R. In this example, just assign values to a var | |
# data_sets <- c("mtcars", "morley", "rock") | |
data_sets <- c("mymtcars","mtcars", "morley", "rock") | |
mymtcars <- mtcars[,1:4] | |
shinyServer(function(input, output) { | |
mymtcars <- mymtcars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dataset <- reactive(function() { | |
input$submitButton | |
write.csv(isolate({ | |
c(input$foo, input$bar) | |
})) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://github.com/livereload/livereload-js/raw/master/dist/livereload.js?host=localhost"></script> |