This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM r-base:latest | |
COPY . /usr/local/src/myscripts | |
WORKDIR /usr/local/src/myscripts | |
CMD ["Rscript", "myscript.R"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(idbr) # devtools::install_github('walkerke/idbr') | |
library(ggplot2) | |
library(animation) | |
library(dplyr) | |
library(ggthemes) | |
idb_api_key("Your Census API key goes here") | |
male <- idb1('JA', 2010:2050, sex = 'male') %>% | |
mutate(POP = POP * -1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggraph) | |
library(gganimate) | |
library(igraph) | |
# Data from http://konect.uni-koblenz.de/networks/sociopatterns-infectious | |
infect <- read.table('out.sociopatterns-infectious', skip = 2, sep = ' ', stringsAsFactors = FALSE) | |
infect$V3 <- NULL | |
names(infect) <- c('from', 'to', 'time') | |
infect$timebins <- as.numeric(cut(infect$time, breaks = 100)) | |
# We want that nice fading effect so we need to add extra data for the trailing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This script is for easily deploying updates to Github repos to your local server. It will automatically git clone or | |
* git pull in your repo directory every time an update is pushed to your $BRANCH (configured below). | |
* | |
* Read more about how to use this script at http://behindcompanies.com/2014/01/a-simple-script-for-deploying-code-with-githubs-webhooks/ | |
* | |
* INSTRUCTIONS: | |
* 1. Edit the variables below | |
* 2. Upload this script to your server somewhere it can be publicly accessed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### r-installation-debain-wheezy | |
#### setup commands to setup R, RStudio and OpenCPU on a Google Compute Engine Wheezy instance | |
#### Mark Edmondson 29 June 2014 | |
## | |
## No original work, all taken from these sources: | |
## https://github.com/jeroenooms/opencpu-deb/blob/master/build-on-debian.md | |
## https://support.rstudio.com/hc/communities/public/questions/200651456-RStudio-server-not-installable-on-Debian-Wheezy-just-released-this-week- | |
## http://cran.r-project.org/bin/linux/debian/README.html | |
# need to be sudo for all below |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
//first we will find the current width and height and declare a few variables that we'll use later | |
var vW = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); | |
var vH = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); | |
var orientation = null; | |
var viewRange = null; | |
//enter the pixel values that trigger your responsive design | |
var breakpoints = [480, 992, 1200]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#global.R | |
#This is the set up of the data files for use in the Map DRG 100 example | |
# We create the master data file which will be subsetted by the Shiny application. The data file is in the working directory for the app | |
# Kevin Little, Ph.D., 13 June 2013 klittle@iecodesign.com | |
# app requires ggplot2 and googleVis packages | |
#example from CMS requires package ggplot2 | |
d1<-read.csv("CMSexample.csv", colClasses="character") | |
summary(d1) | |
for(i in 9:11){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
max_plots <- 5 | |
ui <- fluidPage( | |
headerPanel("Dynamic number of plots"), | |
sidebarPanel( | |
sliderInput("n", "Number of plots", value=1, min=1, max=5) | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |