Skip to content

Instantly share code, notes, and snippets.

View hrbrmstr's full-sized avatar
💤
#tired

boB Rudis hrbrmstr

💤
#tired
View GitHub Profile
@aammd
aammd / character_data.R
Last active August 29, 2015 14:08
This function, based on `rvest`, extracts the Gender, Species, Affilation and Rank for a Star Trek character from the [Star Trek Wiki](http://en.memory-alpha.org/wiki/Portal:Main)
library(rvest)
library(magrittr)
library(tidyr)
library(dplyr)
library(stringr)
character_data <- function(chname){
paste0("http://en.memory-alpha.org/wiki/", chname) %>%
html %>%
html_nodes(".wiki-sidebar") %>%

Playing with adding + operator for easily joining geojson objects together into a single valid geojson object. This is relatively easy with lists, but not so easy with json unless you speak json.

Get lawn package too for viewing data

devtools::install_github("ropensci/geojsonio")
Data sources:
CDC data on vaccine coverage: http://www.cdc.gov/flu/professionals/vaccination/reporti1112/reporti/index.htm
CDC data on current influenza situation: http://gis.cdc.gov/grasp/fluview/fluportaldashboard.html
Historical flu data: http://www.cdc.gov/flu/weekly/pastreports.htm
Locations of hospitals in Boston: https://data.cityofboston.gov/Public-Health/Hospital-Locations/46f7-2snz
NetLogo, a simple agent based model: http://ccl.northwestern.edu/netlogo/
Nemsis, emergency medical services API (haven't used this one myself): http://www.nemsis.org/v3/downloads/v3Archive.html
Written for R, but useful for epi basics in any language: cran.r-project.org/doc/contrib/Epicalc_Book.pdf
"Provides access to health statistics and information on hospital inpatient and emergency department utilization": http://hcupnet.ahrq.gov/
Healthcare Research and Quality data directory: http://www.ahrq.gov/data/dataresources.htm
@jfreels
jfreels / README.md
Last active December 25, 2015 02:59
R + Shiny + d3js: Blank template.
@patperu
patperu / get_measures.R
Last active February 11, 2016 16:29
Markers and request from - http://anasim.iet.unipi.it/moniqa/#home
library('httr')
library('jsonlite')
get_measures <- function(deviceid) {
.h <- list(
"Origin" = "http://anasim.iet.unipi.it",
"Accept-Encoding" = "gzip, deflate",
"Accept-Language" = "it-IT,it;q=0.8,en-US;q=0.6,en;q=0.4",
"User-Agent" = "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.103 Safari/537.36",

The FBI Unified Crime Reporting folks have released a treaure trove of data but stuck it behind either an API or a ReactJS interactive bulk download selection process. The links here were generated from the obfuscated js data elements. This shld make it easier for folks to download the entire data set in bulk.

@braintreeps
braintreeps / map.R
Created February 21, 2013 16:48
This is the R code to go along with the blog post "Mapping 35 Million Credit Cards On Top of Census Data With R".
library(data.table);
library(maps);
library(maptools);
library(spatstat);
library(zipcode);
library(GISTools)
#load the zipcode dataset
data(zipcode);
@cpsievert
cpsievert / europe.R
Last active December 1, 2017 23:05 — forked from halhen/europe.R
library(tidyverse)
library(plotly)
# I'm being lazy, please don't do this
# setwd("~/Downloads/Version 2_0_1/")
d <- read_csv('GEOSTAT_grid_POP_1K_2011_V2_0_1.csv') %>%
rbind(read_csv('JRC-GHSL_AIT-grid-POP_1K_2011.csv') %>%
mutate(TOT_P_CON_DT = '')) %>%
mutate(
@simonecorsi
simonecorsi / git-create-remote.sh
Last active January 16, 2018 04:59
This function will walk you through the creation of a remote repository on github without wasting your precious time going to the website :)
# This function will walk you through the creation of a remote repository on github
# without wasting your precious time going to the website :)
# how:
# - source it in your (bash|zsh)rc
# - change the alias at the bottom of the script to your needs
# - call it, follow instructions... profit
function createRemoteGitRepository() {
local RED='\033[0;31m'
local NC='\033[0m' # No Color
local GITHUB_USER=''
Only including this file so the title of the gist isn't `.gitignore`