-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Bug Fixes * Fixed API call 403 issue with `inflation_adjust()` function. ## Features * Added `county_fips()` function to list county FIPS codes for a specific state. ## Data * Updated all internal data sets. ## Removed * Removed all mapping functions and data, recommend to use the `tigris` package for these activities. * Removed qcew_api function.
- Loading branch information
Showing
49 changed files
with
424 additions
and
8,845 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ | |
^cran-comments\.md$ | ||
^appveyor\.yml$ | ||
^CRAN-SUBMISSION$ | ||
^revdep$ | ||
^\.github$ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.html |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
on: | ||
push: | ||
branches: [main, master] | ||
pull_request: | ||
branches: [main, master] | ||
|
||
name: R-CMD-check | ||
|
||
jobs: | ||
R-CMD-check: | ||
runs-on: ${{ matrix.config.os }} | ||
|
||
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {os: macos-latest, r: 'release'} | ||
- {os: windows-latest, r: 'release'} | ||
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} | ||
- {os: ubuntu-latest, r: 'release'} | ||
- {os: ubuntu-latest, r: 'oldrel-1'} | ||
|
||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
R_KEEP_PKG_SOURCE: yes | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-pandoc@v2 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
http-user-agent: ${{ matrix.config.http-user-agent }} | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::rcmdcheck | ||
needs: check | ||
|
||
- uses: r-lib/actions/check-r-package@v2 | ||
with: | ||
upload-snapshots: true | ||
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
Package: blscrapeR | ||
Type: Package | ||
Title: An API Wrapper for the Bureau of Labor Statistics (BLS) | ||
Version: 3.2.2 | ||
Title: An API Wrapper for the United States Bureau of Labor Statistics | ||
Version: 4.0.0 | ||
Authors@R: person("Kris", "Eberwein", email = "[email protected]", | ||
role = c("aut", "cre")) | ||
Description: Scrapes various data from <https://www.bls.gov/>. The U.S. Bureau of Labor Statistics is the statistical branch of the United States Department of Labor. The package has additional functions to help parse, analyze and visualize the data. | ||
Description: Scrapes various data from United States Bureau of Labor Statistics. The Bureau of Labor Statistics is the statistical branch of the United States Department of Labor. The package has additional functions to help parse, analyze and visualize the data. | ||
Depends: R (>= 3.5.0) | ||
Imports: | ||
httr, | ||
jsonlite, | ||
ggplot2, | ||
magrittr, | ||
utils, | ||
stats, | ||
grDevices, | ||
dplyr, | ||
purrr, | ||
tibble, | ||
|
@@ -27,4 +25,4 @@ URL: https://github.com/keberwein/blscrapeR | |
BugReports: https://github.com/keberwein/blscrapeR/issues | ||
LazyData: true | ||
VignetteBuilder: knitr | ||
RoxygenNote: 7.2.1 | ||
RoxygenNote: 7.2.3 |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#' @title Return a dataframe of county FIPS codes by state. | ||
#' @description Returns a data frame that uses data from the US Census FIPS code list. | ||
#' @param state = A string containing a standard state short abbreviation, i.e. FL, WA, OH, etc. | ||
#' @param ... additional arguments | ||
#' @importFrom stats aggregate | ||
#' @importFrom dplyr filter | ||
#' @importFrom tibble as_tibble | ||
#' @importFrom stringr str_trim | ||
#' @export county_fips | ||
#' @return A tibble from the BLS API. | ||
#' @examples | ||
#' \dontrun{ | ||
#' ## Get historical USD values based on a 2010 dollar. | ||
#' values <- county_fips(state = "FL") | ||
#' } | ||
#' | ||
|
||
county_fips <- function(state, ...) { | ||
# Define a list of valid state abbreviations | ||
valid_states <- c("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", | ||
"HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", | ||
"MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", | ||
"NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", | ||
"SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", | ||
"AS", "DC", "FM", "GU", "MH", "MP", "PW", "PR", "VI") | ||
|
||
# Convert the input to uppercase and trim white space | ||
state_in <- toupper(str_trim(state)) | ||
|
||
# Check if the input is a valid state abbreviation | ||
if (!(state_in %in% valid_states)) { | ||
stop("Invalid state abbreviation. Please provide a valid US state or territory.") | ||
} | ||
|
||
fips_in <- blscrapeR::county_fips | ||
|
||
fips <- fips_in %>% filter(state == state_in) %>% tibble::as_tibble() | ||
|
||
return(fips) | ||
} | ||
|
||
|
||
|
This file contains 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
Oops, something went wrong.