Last active
October 14, 2015 20:01
-
-
Save benjamin-chan/ae1a3bface78a3c95ac9 to your computer and use it in GitHub Desktop.
Rural-Urban Commuting Area Codes (RUCAs)
This file contains hidden or 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
# Source: http://depts.washington.edu/uwruca/ruca-data.php | |
# Code definitions: http://depts.washington.edu/uwruca/ruca-codes.php | |
url <- "http://depts.washington.edu/uwruca/ruca_data/2006%20Complete%20Excel%20RUCA%20file.xls.zip" | |
path <- tempdir() | |
f <- tempfile() | |
download.file(url, f) | |
unzip(f, list=TRUE) | |
filenames <- unzip(f, list=TRUE)[, "Name"] | |
isValidFile <- grep("^[0-9a-z]", filenames, ignore.case=TRUE) | |
unzip(f, files=filenames[isValidFile], exdir=path) | |
# install.packages("readxl") | |
library(readxl) | |
f <- file.path(tempdir(), filenames[isValidFile]) | |
file.info(f) | |
ruca <- read_excel(f) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment