Skip to content

Instantly share code, notes, and snippets.

View McClellandLegge's full-sized avatar

McClelland Legge McClellandLegge

View GitHub Profile
@McClellandLegge
McClellandLegge / demo.Rmd
Created February 11, 2019 18:31
Using Object in Shiny App that is defined in another code chunk
---
title: "Demo"
runtime: shiny
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
df <- head(WorldPhones, 5)
```
@McClellandLegge
McClellandLegge / app.R
Last active April 27, 2018 20:55
Dynamic Animation Speed
library("shiny")
ui <- fluidPage(
includeScript('shiny-events.js'),
numericInput("min", "Min", value = 0, min = 0, max = 10),
numericInput("max", "Max", value = 100, min = 100, max = 200),
sliderInput("speed", "Animation Speed", value = 100, ticks = FALSE, round = 50, min = 50, max = 1000),
uiOutput('slider_div'),
br(),
@McClellandLegge
McClellandLegge / app.R
Created March 31, 2017 18:58
Null Plotly Object
library("shiny")
library("plotly")
set.seed(100)
d <- diamonds[sample(nrow(diamonds), 1000), ]
ui <- fluidPage(
titlePanel("Null Plotly Object"),
@McClellandLegge
McClellandLegge / server.R
Created May 19, 2016 13:42 — forked from withr/server.R
"Calculation In Process..." busy indictor
shinyServer(function(input, output) {
output$obs <- renderUI({
sliderInput("obs", "Number of observations:",
min = 10000, max = 90000,
value = 50000, step = 10000)
})
output$distPlot <- renderPlot({
if (!is.null(input$obs)) {
dist <- NULL
for (i in 1:input$obs) {