Skip to content

Instantly share code, notes, and snippets.

View pssguy's full-sized avatar

Andrew Clark pssguy

View GitHub Profile
@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 / 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 November 15, 2012 21:01
Shiny example: EPL Players Goal Scoring Runs
library(shiny)
library(ggplot2)
# data based on goals scored to early November 2012
url <- "http://www.premiersoccerstats.com/plScoringRuns.csv"
df <- read.csv(url,stringsAsFactors=FALSE)
# create the data for the selectInput
playerChoices <- unique(df[,c(1,2)])$PLAYERID
@pssguy
pssguy / global.R
Created November 16, 2012 00:40
Shiny App showing graphs of goal methods for all EPL players with more than 50 career goals
# My first tiny-shiny
# Thanks to all the guys at R-Studio, especially Joe Cheng for some hand-holding
# The global.r script can hold variables available to both ui.r and server.R
library(shiny)
library(ggplot2)
# data based on goals scored to early November 2012
df <- read.csv("http://www.premiersoccerstats.com/shinyGoals.csv",stringsAsFactors=FALSE)
@pssguy
pssguy / global.R
Last active December 18, 2015 08:09 — forked from sckott/server.r
library(shiny)
library(shinyIncubator)
library(rbison)
library(rjson)
library(taxize)
library(plyr)
library(googleVis)
library(XML)
library(stringr)
@pssguy
pssguy / bestRank.csv
Last active December 18, 2015 19:29
Provides plots and tables based on the packages downloaded from the RStudio CRAN mirror. It is a Shiny App using rCharts so users can specify packages, countries and weeks of interest them and get interactive charts with tooltips and clickable links to package pdfs. The gist utilizes a limited amout of data. The production App can be viewed at h…
package mostDownloads bestRank week tot rank
shiny 1018 70 2013-06-10 1018 70
RColorBrewer 4376 4 2013-04-29 3408 4
scales 3976 6 2012-12-10 1571 6
scales 3976 6 2012-12-03 1720 6
reshape2 4330 6 2012-12-17 1312 6
reshape2 4330 6 2013-01-07 2199 6
reshape2 4330 6 2013-05-13 3660 6
proto 3902 3 2012-12-24 963 3
ggplot2 5291 1 2013-03-25 3160 1
@pssguy
pssguy / Lineups.csv
Last active December 19, 2015 00:29
Test. EPL charts and lineups
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 7.
"COUNTRY","PLAYERID","BIRTHDATE","POSITION","FIRSTNAME","LASTNAME","TEAMID","Goals","TEAMNAME","Opponents","OppID","START","subOn","OFF","PENS","CARD","Result","OwnGoal","gameDate","venue","Assists","TEAMMATCHID","MATCHID","iso2c"
"Cyprus","GOSSJ","1965-05-11","M","Jeremy","Goss","NOR",0,"Norwich C","Arsenal","ARS",3,0,0,0,NA,"W",NA,"1992-08-15","A",2,21000,1313,"CY"
"Denmark","MOLBYJ","1963-07-04","M","Jan","Molby","LIV",0,"Liverpool","Arsenal","ARS",3,0,0,0,NA,"L",NA,"1992-08-23","H",NA,20032,1345,"DK"
"Denmark","JENSENJ","1965-05-03","M","John","Jensen","ARS",0,"Arsenal","QPR","QPR",3,0,0,0,NA,"N",NA,"1992-09-02","A",NA,21061,1374,"DK"
"Denmark","JENSENJ","1965-05-03","M","John","Jensen","ARS",0,"Arsenal","Norwich C","NOR",3,0,0,0,NA,"L",NA,"1992-08-15","H",NA,20000,1313,"DK"
"Denmark","JENSENJ","1965-05-03","M","John","Jensen","ARS",0,"Arsenal","Liverpool","LIV",4,0,0,0,"Y","W",NA,"1992-08-23","A",NA,21032,1345,"DK"
"England","CULVERI","1964-09-22","D","Ian","Culverhouse","NOR",0,"Norwich C","Arsenal","AR
@pssguy
pssguy / horizon.html
Created July 11, 2013 22:07
testing horizon in rCharts
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='C:\Users\Andy\Documents\R\win-library\3.0\rCharts\libraries\widgets\d3_horizon/js/d3.v3.js' type='text/javascript'></script>
<script src='C:\Users\Andy\Documents\R\win-library\3.0\rCharts\libraries\widgets\d3_horizon/js/horizon.js' type='text/javascript'></script>
<style>
@pssguy
pssguy / horizon.html
Created July 11, 2013 22:07
testing horizon in rCharts
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='C:\Users\Andy\Documents\R\win-library\3.0\rCharts\libraries\widgets\d3_horizon/js/d3.v3.js' type='text/javascript'></script>
<script src='C:\Users\Andy\Documents\R\win-library\3.0\rCharts\libraries\widgets\d3_horizon/js/horizon.js' type='text/javascript'></script>
<style>