Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Clark pssguy

View GitHub Profile
@pssguy
pssguy / test.rmd
Created Mar 10, 2016
R markDowntest for JJ Allaire
View test.rmd
---
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 Feb 21, 2015
rbokeh contour with MASS
View bokeh.min.css
.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 Feb 21, 2015
rbokeh contour with MASS
View bokeh.min.css
.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 Mar 5, 2014
Testing selectizeInput
View global.R
n_choices <- 20000
choices <- paste0("choice", 1:n_choices)
names(choices) <- paste(choices, "name")
@pssguy
pssguy / server.R
Created Dec 20, 2013
Shiny Nvigation Test
View server.R
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 Dec 20, 2015
Nested tabsets
View server.R
require(shiny)
shinyServer(function(input, output, session) {
})
@pssguy
pssguy / global.R
Last active Dec 20, 2015
simple dataTabls setup
View global.R
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 Jul 25, 2013
Attempt to combine 2 highcharts
View charts.R
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 Dec 19, 2015
googleCharts in Shiny
View server.R
library(googleCharts)
library(googleVis)
library(shiny)
shinyServer(function(input, output, session) {
# this works
output$scatter1 <- reactive({
@pssguy
pssguy / runChase.R
Last active Dec 19, 2015
Run Chases in Test Matches
View runChase.R
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,
You can’t perform that action at this time.