Skip to content

Instantly share code, notes, and snippets.

View pssguy's full-sized avatar

Andrew Clark pssguy

View GitHub Profile
@pssguy
pssguy / test.rmd
Created March 10, 2016 17:08
R markDowntest for JJ Allaire
---
title: "Sometimes I do not want to see this"
author: "mytinyshinys"
date: "March 4, 2016"
output:
html_document:
fig_caption: yes
theme: flatly
toc: true
toc_float: true
@pssguy
pssguy / bokeh.min.css
Created February 21, 2015 04:57
rbokeh contour with MASS
.bk-bs-container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.bk-bs-container{width:750px}}@media (min-width:992px){.bk-bs-container{width:970px}}@media (min-width:1200px){.bk-bs-container{width:1170px}}.bk-bs-container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.bk-bs-row{margin-left:-15px;margin-right:-15px}.bk-bs-col-xs-1,.bk-bs-col-sm-1,.bk-bs-col-md-1,.bk-bs-col-lg-1,.bk-bs-col-xs-2,.bk-bs-col-sm-2,.bk-bs-col-md-2,.bk-bs-col-lg-2,.bk-bs-col-xs-3,.bk-bs-col-sm-3,.bk-bs-col-md-3,.bk-bs-col-lg-3,.bk-bs-col-xs-4,.bk-bs-col-sm-4,.bk-bs-col-md-4,.bk-bs-col-lg-4,.bk-bs-col-xs-5,.bk-bs-col-sm-5,.bk-bs-col-md-5,.bk-bs-col-lg-5,.bk-bs-col-xs-6,.bk-bs-col-sm-6,.bk-bs-col-md-6,.bk-bs-col-lg-6,.bk-bs-col-xs-7,.bk-bs-col-sm-7,.bk-bs-col-md-7,.bk-bs-col-lg-7,.bk-bs-col-xs-8,.bk-bs-col-sm-8,.bk-bs-col-md-8,.bk-bs-col-lg-8,.bk-bs-col-xs-9,.bk-bs-col-sm-9,.bk-bs-col-md-9,.bk-bs-col-lg-9,.bk-bs-col-xs-10,.bk-bs-col-sm-10,.bk-bs-col-md-1
@pssguy
pssguy / bokeh.min.css
Created February 21, 2015 04:57
rbokeh contour with MASS
.bk-bs-container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.bk-bs-container{width:750px}}@media (min-width:992px){.bk-bs-container{width:970px}}@media (min-width:1200px){.bk-bs-container{width:1170px}}.bk-bs-container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.bk-bs-row{margin-left:-15px;margin-right:-15px}.bk-bs-col-xs-1,.bk-bs-col-sm-1,.bk-bs-col-md-1,.bk-bs-col-lg-1,.bk-bs-col-xs-2,.bk-bs-col-sm-2,.bk-bs-col-md-2,.bk-bs-col-lg-2,.bk-bs-col-xs-3,.bk-bs-col-sm-3,.bk-bs-col-md-3,.bk-bs-col-lg-3,.bk-bs-col-xs-4,.bk-bs-col-sm-4,.bk-bs-col-md-4,.bk-bs-col-lg-4,.bk-bs-col-xs-5,.bk-bs-col-sm-5,.bk-bs-col-md-5,.bk-bs-col-lg-5,.bk-bs-col-xs-6,.bk-bs-col-sm-6,.bk-bs-col-md-6,.bk-bs-col-lg-6,.bk-bs-col-xs-7,.bk-bs-col-sm-7,.bk-bs-col-md-7,.bk-bs-col-lg-7,.bk-bs-col-xs-8,.bk-bs-col-sm-8,.bk-bs-col-md-8,.bk-bs-col-lg-8,.bk-bs-col-xs-9,.bk-bs-col-sm-9,.bk-bs-col-md-9,.bk-bs-col-lg-9,.bk-bs-col-xs-10,.bk-bs-col-sm-10,.bk-bs-col-md-1
@pssguy
pssguy / global.R
Created March 5, 2014 00:03
Testing selectizeInput
n_choices <- 20000
choices <- paste0("choice", 1:n_choices)
names(choices) <- paste(choices, "name")
@pssguy
pssguy / server.R
Created December 20, 2013 22:00
Shiny Nvigation Test
shinyServer(function(input, output, session) {
## code for Distribution option
output$distPlot <- renderPlot({
# generate an rnorm distribution and plot it
dist <- rnorm(input$obs)
hist(dist)
})
@pssguy
pssguy / server.R
Last active December 20, 2015 11:49
Nested tabsets
require(shiny)
shinyServer(function(input, output, session) {
})
@pssguy
pssguy / global.R
Last active December 20, 2015 10:39
simple dataTabls setup
require(shiny)
require(rCharts)
names<- letters
numbers <- 1:26
dates <- rep(as.Date(c("2010-01-01","2011-07-23","2011-01-03")),8)
dates <- c(dates,as.Date(c("1999-12-25", "2005-07-13")))
df <- data.frame(names=names,numbers=numbers,dates=dates)
@pssguy
pssguy / charts.R
Created July 25, 2013 17:37
Attempt to combine 2 highcharts
area <- rCharts:::Highcharts$new()
area$series(data = toJSONArray2(valdf, json = F, names = F),type = "area", name="Points")
area$yAxis(title=list(text="Points"),opposite=TRUE)
area$xAxis(labels=list(enabled=FALSE))
area$plotOptions(area = list(marker = list(enabled = FALSE,symbol = "circle", radius = 2)))
area$chart(zoomType="xy")
area$title(text="World Ranking")
area$subtitle(text="Zoom for closer look")
area$chart(height=300)
area
@pssguy
pssguy / server.R
Last active December 19, 2015 22:09
googleCharts in Shiny
library(googleCharts)
library(googleVis)
library(shiny)
shinyServer(function(input, output, session) {
# this works
output$scatter1 <- reactive({
@pssguy
pssguy / runChase.R
Last active December 19, 2015 17:19
Run Chases in Test Matches
require(rCharts)
df <- read.csv("runChase.csv", stringsAsFactors=F)
df$tt <-sprintf("<table cellpadding='4' style='line-height:1.5'><tr><th>%1$s %2$s</th></tr><tr><td align='left'>%3$s %4$s<br><br>%5$s %6$s<br>Target %7$s</td></tr></table>",
df$Team,
df$Opposition,
df$Ground,
df$startDate,