-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
110 lines (91 loc) · 4.14 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# tinytiger <a href="https://alarm-redist.org/tinytiger/"><img src="man/figures/logo.png" align="right" height="138" /></a>
<!-- badges: start -->
[](https://CRAN.R-project.org/package=tinytiger)
[](https://github.com/alarm-redist/tinytiger/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
`tinytiger` is to provide a lightweight interface to the [US Census Bureau's TIGER/Line Shapefiles](https://www.census.gov/geographies/mapping-files/time-series/geo/tiger-line-file.html).
It has four dependencies other than `sf`.
Download caching is supported; [see below](#downloading-and-caching) for details.
## Installation
Install `tinytiger` from CRAN with:
``` r
install.packages("tinytiger")
```
You can also install the development version of `tinytiger`:
``` r
remotes::install_github("alarm-redist/tinytiger")
```
## Example
`tinytiger` provides lightweight functions to download Census Bureau TIGER/Line Shapefiles.
To download a geography, simply use the function corresponding to one of the supported geographies.
```{r example}
library(tinytiger)
tt_counties("NY")
```
## Supported Geographies
- `tt_address_ranges()`: Address Ranges
- `tt_ai_an_nh_areas()`: American Indian / Alaska Native / Native Hawaiian Areas
- `tt_tribal_subdivisions()`: Tribal Subdivisions
- `tt_anrc()`: Alaskan Native Regional Corporations
- `tt_area_landmarks()`: Area Landmarks
- `tt_area_water():` Area Water
- `tt_block_groups()`: Block Groups
- `tt_cbsa()`: Core Based Statistical Areas
- `tt_congressional_districts()`: Congressional Districts
- `tt_new_england_combined_areas()`: Combined New England Towns and Cities
- `tt_coastline()`: Coastline
- `tt_consolidated_cities()`: Consolidated Cities
- `tt_counties()`: Counties
- `tt_county_subdivisions()`: County Subdivisions
- `tt_csa()`: Combined Statistical Areas
- `tt_polygon_edges()`: All Polygon Edges
- `tt_elementary_school_districts()`: Elementary School Districts (limited states)
- `tt_estates()`: Estates (Virgin Islands only)
- `tt_polygon_faces()`: All Polygon Faces
- `tt_linear_water():` Linear Water
- `tt_metropolitan_divisions()`: Metropolitan Divisions
- `tt_military()`: Military Installations
- `tt_new_england_cities()`: New England Cities and Towns
- `tt_new_england_city_divisions()`: New England Cities and Towns Divisions
- `tt_places()`: Census Places
- `tt_point_landmarks()`: Point Landmarks
- `tt_primary_roads()`: Primary Roads
- `tt_primary_secondary_roads()`: Primary and Secondary Roads
- `tt_puma()`: Public Use Microdata Areas
- `tt_rails()`: Railroads
- `tt_roads()`: Roads
- `tt_secondary_school_districts()`: Secondary School Districts (limited states)
- `tt_state_leg_lower()`: Lower State Legislative Districts
- `tt_state_leg_upper()`: Upper State Legislative Districts
- `tt_states()`: States
- `tt_subbarrios()`: Subbarios (Puerto Rico only)
- `tt_blocks()`: Blocks
- `tt_tribal_block_groups()`: Tribal Block Groups
- `tt_tracts()`: Tracts
- `tt_tribal_tracts()`: Tribal Tracts
- `tt_uac()`: : Urban Areas
- `tt_unified_school_districts()`: Unified School Districts
- `tt_voting_districts()`: Voting Districts
- `tt_zcta()`: Zip Code Tabulation Areas
# Downloading and Caching
By default, downloading will print status messages and/or a progress bar.
For silent downloads, set `options(tinytiger.curl_quiet = TRUE)`.
Downloads will go to `options(tinytiger.cache_dir)` if it is set. If it is not,
and `rappdirs` is installed, and `options(tinytiger.use_cache = TRUE)`, downloads
will be cached between sessions in `rappdirs::user_cache_dir("tinytiger")`. If
it is not installed, or if `options(tinytiger.use_cache = FALSE)`, then the cache
will be in a temporary directory that does not persist between sessions. You can
check the size of the cache and clear it with `tt_cache_size()` and
`tt_cache_clear()`.