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(maptools) | |
library(mapproj) | |
library(rgeos) | |
library(rgdal) | |
library(ggplot2) | |
# for theme_map | |
devtools::source_gist("33baa3a79c5cfef0f6df") | |
# nice US map GeoJSON |
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 3.
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
"Country Name","Country Code","Indicator Name","Indicator Code","1961","1962","1963","1964","1965","1966","1967","1968","1969","1970","1971","1972","1973","1974","1975","1976","1977","1978","1979","1980","1981","1982","1983","1984","1985","1986","1987","1988","1989","1990","1991","1992","1993","1994","1995","1996","1997","1998","1999","2000","2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014", | |
"Aruba","ABW","Population, total","SP.POP.TOTL","55435","56226","56697","57029","57360","57712","58049","58385","58724","59065","59438","59849","60239","60525","60655","60589","60366","60106","59978","60096","60567","61344","62204","62831","63028","62644","61835","61077","61032","62148","64623","68235","72498","76700","80326","83195","85447","87276","89004","90858","92894","94995","97015","98742","100031","100830","101219","101344","101418","101597","101932","102384","102911","", | |
"Andorra","AND","Population, total","SP.POP.TOTL","14376","15376","16410","17470","18551","19646 |
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(maptools) | |
library(mapproj) | |
library(rgeos) | |
library(rgdal) | |
library(ggplot2) | |
library(jsonlite) | |
library(RCurl) | |
# for theme_map | |
devtools::source_gist("33baa3a79c5cfef0f6df") |
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(magrittr) | |
library(rvest) | |
library(data.table) | |
library(dplyr) | |
library(pbapply) | |
library(stringr) | |
fetch_attendance <- function(year=1990) { | |
url <- sprintf("http://www.baseball-reference.com/leagues/MLB/%s-misc.shtml", year) | |
html(url) %>% html_table %>% .[[1]] %>% mutate(year=year) |
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
511NY.GOV | |
ABILITYONE.FED.US | |
ACCESS-BOARD-MEMBERS.GOV | |
ADMONGO.GOV | |
ALADA.GOV | |
ALADNA.GOV | |
ANNUALCREDITREPORT.GOV | |
AZCORPCOM.GOV | |
AZCORPCOMM.GOV | |
BERRIENCOUNTY-MI.GOV |
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(rgdal) | |
library(rgeos) | |
library(maptools) | |
library(mapproj) | |
us <- readOGR("http://bl.ocks.org/mbostock/raw/4090846/us.json", "states") | |
proj4string(us) <- CRS("+proj=merc") | |
map <- fortify(us) |
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(rgdal) | |
library(magrittr) | |
# save this locally for realz | |
world <- readOGR("https://raw.githubusercontent.com/AshKyd/geojson-regions/master/data/source/ne_50m_admin_0_countries.geo.json", "OGRGeoJSON") | |
# assumes 'places' is a data.frame with at least lat/lon columns | |
places %>% |
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
Gender Grade Age Race Urban/Rural School Goals Grades Sports Looks Money | |
boy 5 11 White Rural Elm Sports 1 2 4 3 | |
boy 5 10 White Rural Elm Popular 2 1 4 3 | |
girl 5 11 White Rural Elm Popular 4 3 1 2 | |
girl 5 11 White Rural Elm Popular 2 3 4 1 | |
girl 5 10 White Rural Elm Popular 4 2 1 3 | |
girl 5 11 White Rural Elm Popular 4 2 1 3 | |
girl 5 10 White Rural Elm Popular 3 4 1 2 | |
girl 5 10 White Rural Elm Grades 3 4 2 1 | |
girl 5 10 White Rural Elm Sports 3 2 1 4 |
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(rgeos) | |
library(rgdal) | |
library(httr) | |
library(dplyr) | |
geo_init <- function() { | |
try({ | |
GET("http://www.mapcruzin.com/fcc-wireless-shapefiles/cities-towns.zip", | |
write_disk("cities.zip")) |
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
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 |