Skip to content

Commit

Permalink
Documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonma committed May 13, 2023
1 parent 7ab3bc1 commit be2d1df
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 24 deletions.
31 changes: 22 additions & 9 deletions README.Rmd
@@ -1,9 +1,7 @@
---
title: "README"
author:
- Jamaal Green, University of Pennsylvania; Dillon Mahmoudi, University of Maryland Baltimore County; Liming Wang, Portland State University
author: "Jamaal Green, University of Pennsylvania; Dillon Mahmoudi, University of Maryland Baltimore County; Liming Wang, Portland State University"
output: github_document
compact-title: false
---

<!-- README.md is generated from README.Rmd. Please edit that file -->
Expand Down Expand Up @@ -51,22 +49,37 @@ devtools::install_github("jamgreen/lehdr")

## Usage

After loading the library, this first example pulls the Oregon (`state = "or"`) 2014 (`year = 2014`), origin-destination (`lodes_type = "od"`), all jobs including private primary, secondary, and Federal (`job_type = "JT01"`), all jobs across ages, earnings, and industry (`segment = "S000"`), aggregated at the Census Tract level rather than the default Census Block (`agg_geo = "tract"`).
This first example pulls the Oregon (`state = "or"`) 2020 (`year = 2020`) from LODES version 8 (`version="LODES8"`, default), origin-destination (`lodes_type = "od"`), all jobs including private primary, secondary, and Federal (`job_type = "JT01"`, default), all jobs across ages, earnings, and industry (`segment = "S000"`, default), aggregated at the Census Tract level rather than the default Census Block (`agg_geo = "tract"`).

```{r usage1, eval=FALSE}
library(lehdr)
grab_lodes(state = "or", year = 2014, lodes_type = "od", job_type = "JT01",
segment = "S000", state_part = "main", agg_geo = "tract")
or_od <- grab_lodes(state = "or",
year = 2020,
version = "LODES8",
lodes_type = "od",
job_type = "JT01",
segment = "S000",
state_part = "main",
agg_geo = "tract")
head(or_od)
```

The package can be used to retrieve multiple states and years at the same time by creating a vector or list. This second example pulls the Oregon AND Rhode Island (`state = c("or", "ri")`) for 2013 and 2014 (`year = c(2013, 2014)` or `year = 2013:2014`).

```{r usage2, eval=FALSE}
grab_lodes(state = c("or", "ri"), year = c(2013, 2014), lodes_type = "od", job_type = "JT01",
segment = "S000", state_part = "main", agg_geo = "tract")
grab_lodes(state = c("or", "ri"),
year = c(2013, 2014),
lodes_type = "od",
job_type = "JT01",
segment = "S000",
state_part = "main",
agg_geo = "tract")
```

Not all years are available for each state. To see all options for `lodes_type`, `job_type`, and `segment` and the availability for each state/year, please see the most recent LEHD Technical Document at https://lehd.ces.census.gov/data/lodes/LODES7/.
Not all years are available for each state. To see all options for `lodes_type`, `job_type`, and `segment` and the availability for each state/year, please see the most recent LEHD Technical Document at https://lehd.ces.census.gov/data/lodes/LODES8/.

Using the optional `version` paramater, users can specify which LODES version to use. Version 8 is default (`version="LODES8"`) is enumerated at 2020 Census blocks. LODES7 (`version="LODES7"`) is enumerated at 2010 Census blocks, but ends in 2019. LODES5 (`version="LODES5"`) is enumerated at 2000 Census blocks, but ends in 2009.

Other common uses might include retrieving Residential or Work Area Characteristics (`lodes_type = "rac"` or `lodes_type = "wac"` respectively), low income jobs (`segment = "SE01"`) or good producing jobs (`segment = "SI01"`). Other common geographies might include retrieving data at the Census Block level (`agg_geo = "block"`, not necessary as it is default).

Expand Down
49 changes: 34 additions & 15 deletions README.md
@@ -1,8 +1,7 @@
README
================
Jamaal Green, University of Pennsylvania;
Dillon Mahmoudi, University of Maryland Baltimore County;
Liming Wang, Portland State University
Jamaal Green, University of Pennsylvania; Dillon Mahmoudi, University of
Maryland Baltimore County; Liming Wang, Portland State University

<!-- README.md is generated from README.Rmd. Please edit that file -->

Expand All @@ -12,7 +11,7 @@ Liming Wang, Portland State University

<!-- badges: start -->

[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/lehdr)](https://cran.r-project.org/package=lehdr)
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/lehdr)](https://cran.r-project.org/package=lehdr)

[![R-CMD-check](https://github.com/jamgreen/lehdr/workflows/R-CMD-check/badge.svg)](https://github.com/jamgreen/lehdr/actions)

Expand Down Expand Up @@ -47,17 +46,26 @@ devtools::install_github("jamgreen/lehdr")

## Usage

After loading the library, this first example pulls the Oregon
(`state = "or"`) 2014 (`year = 2014`), origin-destination
(`lodes_type = "od"`), all jobs including private primary, secondary,
and Federal (`job_type = "JT01"`), all jobs across ages, earnings, and
industry (`segment = "S000"`), aggregated at the Census Tract level
rather than the default Census Block (`agg_geo = "tract"`).
This first example pulls the Oregon (`state = "or"`) 2020
(`year = 2020`) from LODES version 8 (`version="LODES8"`, default),
origin-destination (`lodes_type = "od"`), all jobs including private
primary, secondary, and Federal (`job_type = "JT01"`, default), all jobs
across ages, earnings, and industry (`segment = "S000"`, default),
aggregated at the Census Tract level rather than the default Census
Block (`agg_geo = "tract"`).

``` r
library(lehdr)
grab_lodes(state = "or", year = 2014, lodes_type = "od", job_type = "JT01",
segment = "S000", state_part = "main", agg_geo = "tract")
or_od <- grab_lodes(state = "or",
year = 2020,
version = "LODES8",
lodes_type = "od",
job_type = "JT01",
segment = "S000",
state_part = "main",
agg_geo = "tract")

head(or_od)
```

The package can be used to retrieve multiple states and years at the
Expand All @@ -66,14 +74,25 @@ Oregon AND Rhode Island (`state = c("or", "ri")`) for 2013 and 2014
(`year = c(2013, 2014)` or `year = 2013:2014`).

``` r
grab_lodes(state = c("or", "ri"), year = c(2013, 2014), lodes_type = "od", job_type = "JT01",
segment = "S000", state_part = "main", agg_geo = "tract")
grab_lodes(state = c("or", "ri"),
year = c(2013, 2014),
lodes_type = "od",
job_type = "JT01",
segment = "S000",
state_part = "main",
agg_geo = "tract")
```

Not all years are available for each state. To see all options for
`lodes_type`, `job_type`, and `segment` and the availability for each
state/year, please see the most recent LEHD Technical Document at
<https://lehd.ces.census.gov/data/lodes/LODES7/>.
<https://lehd.ces.census.gov/data/lodes/LODES8/>.

Using the optional `version` paramater, users can specify which LODES
version to use. Version 8 is default (`version="LODES8"`) is enumerated
at 2020 Census blocks. LODES7 (`version="LODES7"`) is enumerated at 2010
Census blocks, but ends in 2019. LODES5 (`version="LODES5"`) is
enumerated at 2000 Census blocks, but ends in 2009.

Other common uses might include retrieving Residential or Work Area
Characteristics (`lodes_type = "rac"` or `lodes_type = "wac"`
Expand Down

0 comments on commit be2d1df

Please sign in to comment.