cfr_text returns a tibble of CFR text

cfr_text(year, title_number, chapter, part, token = "words",
  return_tidytext = TRUE, verbose = FALSE, ...)

Arguments

year

numeric between 1996 and 2018.

title_number

numeric between 1 and 50.

chapter

numeric or roman numeral.

part

numeric.

token

character. Unit for tokenizing. Currently

return_tidytext

logical. TRUE = tidytext, FALSE = raw data

verbose

logical. Will return "helpful" messages regarding the status of the URL.

...

Extra arguments passed on to tokenizers, such as n and k for "ngrams" and "skip_ngrams"

Value

a tibble with year, title_number, chapter, part, and text nested by subpart

Details

cfr_text

This function is the main function of the fedregs package. It takes the title, chapter, part, and year and returns a tibble of raw text (return_tidytext = FALSE) or tidytext text (return_tidytext = TRUE). N.b., it has not been extensively tested on titles and chapters other than Title 50 chapter VI and part 648.

Examples

regs <- cfr_text(year = 2018, title_number = 50, chapter = 6, part = 648, return_tidytext = TRUE, token = "words", verbose = TRUE)
#> Pulling the chapter, part, and volume information from: #> C:\Users\SCOTT~1.LAR\AppData\Local\Temp\RtmpsNwBrG/CFR-2018-title50-vol1.xml.
#> Pulling the chapter, part, and volume information from: #> C:\Users\SCOTT~1.LAR\AppData\Local\Temp\RtmpsNwBrG/CFR-2018-title50-vol10.xml.
#> Pulling the chapter, part, and volume information from: #> C:\Users\SCOTT~1.LAR\AppData\Local\Temp\RtmpsNwBrG/CFR-2018-title50-vol11.xml.
#> Pulling the chapter, part, and volume information from: #> C:\Users\SCOTT~1.LAR\AppData\Local\Temp\RtmpsNwBrG/CFR-2018-title50-vol12.xml.
#> Pulling the chapter, part, and volume information from: #> C:\Users\SCOTT~1.LAR\AppData\Local\Temp\RtmpsNwBrG/CFR-2018-title50-vol13.xml.
#> Pulling the chapter, part, and volume information from: #> C:\Users\SCOTT~1.LAR\AppData\Local\Temp\RtmpsNwBrG/CFR-2018-title50-vol2.xml.
#> Pulling the chapter, part, and volume information from: #> C:\Users\SCOTT~1.LAR\AppData\Local\Temp\RtmpsNwBrG/CFR-2018-title50-vol3.xml.
#> Pulling the chapter, part, and volume information from: #> C:\Users\SCOTT~1.LAR\AppData\Local\Temp\RtmpsNwBrG/CFR-2018-title50-vol4.xml.
#> Pulling the chapter, part, and volume information from: #> C:\Users\SCOTT~1.LAR\AppData\Local\Temp\RtmpsNwBrG/CFR-2018-title50-vol5.xml.
#> Pulling the chapter, part, and volume information from: #> C:\Users\SCOTT~1.LAR\AppData\Local\Temp\RtmpsNwBrG/CFR-2018-title50-vol6.xml.
#> Pulling the chapter, part, and volume information from: #> C:\Users\SCOTT~1.LAR\AppData\Local\Temp\RtmpsNwBrG/CFR-2018-title50-vol7.xml.
#> Pulling the chapter, part, and volume information from: #> C:\Users\SCOTT~1.LAR\AppData\Local\Temp\RtmpsNwBrG/CFR-2018-title50-vol8.xml.
#> Pulling the chapter, part, and volume information from: #> C:\Users\SCOTT~1.LAR\AppData\Local\Temp\RtmpsNwBrG/CFR-2018-title50-vol9.xml.
head(regs)
#> # A tibble: 6 x 6 #> # Groups: subpart, year, title_number, chapter, part [6] #> subpart year title_number chapter part data #> <chr> <dbl> <dbl> <chr> <dbl> <list> #> 1 Subpart A—General Provisions 2018 50 VI 648 <tibble [~ #> 2 Subpart B—Management Measures for~ 2018 50 VI 648 <tibble [~ #> 3 Subpart C—Management Measures for~ 2018 50 VI 648 <tibble [~ #> 4 Subpart D—Management Measures for~ 2018 50 VI 648 <tibble [~ #> 5 NA 2018 50 VI 648 <tibble [~ #> 6 Subpart E—Management Measures for~ 2018 50 VI 648 <tibble [~