Skip to content

Instantly share code, notes, and snippets.

@walkerke
Created January 13, 2023 20:14
Show Gist options
  • Save walkerke/960d80226de3d74334f0bceb378feef6 to your computer and use it in GitHub Desktop.
Save walkerke/960d80226de3d74334f0bceb378feef6 to your computer and use it in GitHub Desktop.
# remotes::install_github("walkerke/tigris")
library(tigris)
options(tigris_use_cache = TRUE)
dfw_box <- c(-98.324890,31.877558,-95.344849,33.493307)
dfw_ua_10 <- urban_areas(filter_by = dfw_box)
dfw_ua_20 <- urban_areas(year = 2020, criteria = "2020",
filter_by = dfw_box)
mapview::mapview(dfw_ua_10, layer.name = "2010", col.regions = "blue") |
mapview::mapview(dfw_ua_20, layer.name = "2020", col.regions = "red")
@walkerke
Copy link
Author

walkerke commented Feb 2, 2023

@Yingjie4Science you'll need version 2.0.1 (the latest version) for this to work. A fresh update of the package should do it!

@Yingjie4Science
Copy link

Yingjie4Science commented Feb 2, 2023

Hi again, the same error with the latest version.

library(tigris)
packageVersion("tigris")
[1] ‘2.0.1’

dfw_box <- c(-98.324890,31.877558,-95.344849,33.493307)
dfw_ua_10 <- urban_areas(filter_by = dfw_box)
Error in load_tiger(url, tigris_type = "urban", ...) :
unused argument (filter_by = dfw_box)

@walkerke
Copy link
Author

walkerke commented Feb 2, 2023

Hmm, I can't reproduce that error. Are you outside the United States? The Census Bureau website is blocked in some countries.

@Yingjie4Science
Copy link

Yingjie4Science commented Feb 2, 2023

No, I am based in the US... Never mind... I just restarted R and it works now! Thanks!

@walkerke
Copy link
Author

walkerke commented Feb 2, 2023

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment