I hereby claim:
- I am mkiang on github.
- I am mkiang (https://keybase.io/mkiang) on keybase.
- I have a public key ASBcR0WeyXKq1QlGo0lxZxRG2VRNJKIJ8-h6NNFJLDFSYAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
## Code for the blog post here: | |
## https://mathewkiang.com/2017/10/08/using-r-wikipedia-sherparomeo-show-new-england-journal-medicines-pre-print-statement-empirically-false | |
## You can download the original files from the blogpost. | |
## If downloading new files, you probably want to change the date in the file names. | |
## Imports | |
library(rvest) | |
library(tidyverse) | |
## Wiki data |
#SIR practical from Debarre and Bonhoeffer ("SIR models of epidemics") | |
library(deSolve) | |
parms <- c(beta = 0.333, k = 3 , r = 0.333) | |
inits <- c(S = 499, I = 1, R = 0) | |
dt <- seq(0, 300, 1) | |
SIR <- function(t, x, parms){ | |
with(as.list(c(parms, x)), { | |
## Code for this blog post: https://mathewkiang.com/2017/01/16/using-histogram-legend-choropleths/ | |
## Download the drug death data from: | |
## https://blogs.cdc.gov/nchs-data-visualization/drug-poisoning-mortality/ | |
## | |
## Download the 2013 CB shapefiles (500k will do) for counties and states: | |
## https://www.census.gov/geo/maps-data/data/cbf/cbf_counties.html | |
## https://www.census.gov/geo/maps-data/data/cbf/cbf_state.html | |
## Imports ---- |
import requests | |
import errno | |
import pandas as pd | |
import os | |
def mkdir_p(path): | |
""" If a directory does not exist, create it. """ | |
try: | |
os.makedirs(path) |
## Code for this blog post: | |
## http://mathewkiang.com/2016/10/08/a-visual-tour-of-my-publications/ | |
## Imports | |
library(RColorBrewer) | |
library(ggplot2) | |
library(dplyr) | |
library(devtools) | |
devtools::install_github("jkeirstead/scholar") | |
library(scholar) |
library(microbenchmark) | |
library(ggplot2) | |
library(dplyr) | |
holder <- NULL | |
endpoints <- 10 ^ (1:9) | |
for(endpoint in endpoints) { | |
x <- microbenchmark( | |
seq_len = seq_len(endpoint), | |
colon = 1:endpoint, |
## Side project name: Refilling MTA cards (March 2015 rates) | |
## Author: Mathew Kiang | |
## See: http://mathewkiang.com/2015/03/23/new-metrocard-rates-and-the-dreaded-dead-zone-of-change/ | |
library(ggplot2) | |
## Define parameters | |
price <- 2.75 | |
bonus <- 1.11 | |
lim <- 0.15 # amount of change willing to tolerate | |
upp <- 25 # upper limit to amount deposited |
## Side project name: Boston winters for the last ten years | |
## Author: M Kiang | |
## Data: http://www.ncdc.noaa.gov/snow-and-ice/daily-snow/ | |
library(ggplot2) | |
library(dplyr) | |
library(tidyr) | |
# library(scales) | |
# library(gridExtra) | |
# library(directlabels) |
# See https://github.com/mkiang/OpenSEIR for comments or updates. | |
library(shiny) | |
library(deSolve) | |
library(ggplot2) | |
shinyServer(function(input, output) { | |
# Define the SEIR model for open population | |
# b is transmission probability, k is contact rate, r is recovery rate, | |
# bd is birth/death rate, and L is the rate from latent to infectious. |