Skip to content

Instantly share code, notes, and snippets.

@sdaza
Created March 12, 2015 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sdaza/f433f08675aa547680e9 to your computer and use it in GitHub Desktop.
Save sdaza/f433f08675aa547680e9 to your computer and use it in GitHub Desktop.
acs example
library(acs)
rm(list=ls(all=TRUE))
variables <- c("C17002_002", "C17002_003", "C17002_004", "C17002_005","C17002_006", "C17002_001")
dat <- acs.fetch(geo = geo.make(state = "WI", county = "*", tract = "*"), variable = variables)
p_output <- divide.acs(dat[,1] + dat[,2] + dat[,3] + dat[,4] + dat[,5], dat[,6], method = "proportion")
r_output <- divide.acs(dat[,1] + dat[,2] + dat[,3] + dat[,4] + dat[,5], dat[,6], method = "ratio")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment