Skip to content

Instantly share code, notes, and snippets.

@fboehm
Forked from jknowles/server.R
Last active August 29, 2015 14:07
Show Gist options
  • Save fboehm/a7de7dd9a31a8ee3a342 to your computer and use it in GitHub Desktop.
Save fboehm/a7de7dd9a31a8ee3a342 to your computer and use it in GitHub Desktop.
library(shiny)
shinyServer(function(input,output){
output$distPlot<-reactivePlot(function(){
dist<-rnorm(input$obs)
p<-qplot(dist,binwidth=0.1)+geom_vline(xintercept=mean(dist))+theme_dpi()
p<-p+coord_cartesian(xlim=c(-4,4))+geom_vline(xintercept=median(dist),color=I("red"))
print(p)
})
})
library(shiny)
library(ggplot2)
library(eeptools)
shinyUI(pageWithSidebar(
# Title
headerPanel("Normality"),
sidebarPanel(
sliderInput("obs","Number of observations:",
min=0,max=1000,value=100)
),
# GGPLOT
mainPanel(
plotOutput("distPlot")
)
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment