MyNixOS website logo
Description

A Convenient API for Accessing United States Census Bureau's Quarterly Workforce Indicator.

The purpose of this package is to access the United States Census Bureau's Quarterly Workforce Indicator data. Additionally, the data will be retrieved in a tidy format for further manipulation with full variable descriptions added if desired. Information about the United States Census Bureau's Quarterly Workforce Indicator is available at <https://www.census.gov/data/developers/data-sets/qwi.html>.

CRANstatus R buildstatus Travis buildstatus AppVeyor buildstatus Coveragestatus lifecycle DOI

tidyqwi

The goal of tidyqwi is to make accessing the US Census Bureau’s Quarterly Workforce Indicators easier in a tidy format. This package allows a user to specify the years and states of interest as well as some of the additional parameters (desired cross tabs, MSA vs county level data, firm size, etc) and submit them to the US Census API. This package then stays within the US Census guidelines for API submission for this data and returns a combined tidy dataframe for future analysis.

This is a work in progress!

Installation

Install via CRAN with:

install.packages("tidyqwi")

Or the development version at:

remotes::install_github("medewitt/tidyqwi")

Use

After installation you can load and retrieve the desired data!

library(tidyqwi)

nc_qwi <- get_qwi(years = "2010", 
                  states = "11", 
                  geography = "county", 
                  apikey =  census_key, 
                  endpoint = "rh",
                  variables = c("sEmp", "Emp"), all_groups = FALSE,
                  industry_level = "2", processing = "multiprocess")

And look at your data:

head(nc_qwi)
#> # A tibble: 6 x 12
#>   year  quarter agegrp sex   ownercode seasonadj industry state county Emp  
#>   <chr> <chr>   <chr>  <chr> <chr>     <chr>     <chr>    <chr> <chr>  <chr>
#> 1 2010  1       A00    0     A00       U         11       37    001    45   
#> 2 2010  1       A00    0     A00       U         11       37    003    101  
#> 3 2010  1       A00    0     A00       U         11       37    005    82   
#> 4 2010  1       A00    0     A00       U         11       37    007    207  
#> 5 2010  1       A00    0     A00       U         11       37    009    104  
#> 6 2010  1       A00    0     A00       U         11       37    011    77   
#> # … with 2 more variables: sEmp <chr>, year_time <date>

And there are labels added if desired

labelled_nc <- add_qwi_labels(nc_qwi)
Hmisc::describe(labelled_nc$Emp)
#> labelled_nc$Emp : Beginning-of-Quarter Employment: Counts 
#>        n  missing distinct     Info     Mean      Gmd      .05      .10 
#>     7345      411     2851        1     2018     3129       24       40 
#>      .25      .50      .75      .90      .95 
#>      132      448     1550     4355     8099 
#> 
#> lowest :     0     1     3     4     5, highest: 65243 81884 82723 84038 84674
library(ggplot2)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union

labelled_nc %>%
  as_tibble() %>% 
  dplyr::filter(county == "067") %>% 
  ggplot(aes(year_time, Emp, color = county))+
  geom_line()+
  scale_y_log10()+
  facet_wrap(~industry)+
  labs(
    title = "Quarterly Workforce Indicators for Forsyth County",
    subtitle = attributes(labelled_nc$Emp)$label,
    caption = "Data: US Census Bureau QWI",
    x = "Month"
  )+
  theme_minimal()

Please note that the ‘tidyqwi’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Metadata

Version

0.1.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows