Skip to content

Instantly share code, notes, and snippets.

Avatar

Travis Hinkelman hinkelman

View GitHub Profile
@hinkelman
hinkelman / server.R
Created Oct 17, 2013
Demo of problem with renderUI and animation slider
View server.R
library(shiny)
grp <- c(rep("A", 900), rep("B", 1200))
# Define server logic for slider examples
shinyServer(function(input, output) {
sub <- reactive({
grp[grp %in% input$group]
})
View CountGLM.R
n = 100 # No. of samples per treatment
mean.A = 10 # Mean count for treatment A
mean.B = 5 # Mean count for treatment B
nd = data.frame(Trt = c("A", "B")) # Used in predict( ) function
# Generate example data based on Poisson distribution (mean = variance)
data.pois = data.frame(Trt = c(rep("A", n), rep("B", n)),
Response = c(rpois(n, mean.A), rpois(n, mean.B))
)