cfr_text
returns a tibble of CFR text
cfr_text(year, title_number, chapter, part, token = "words", return_tidytext = TRUE, verbose = FALSE, ...)
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" |
a tibble with year, title_number, chapter, part, and text nested by subpart
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.
regs <- cfr_text(year = 2018, title_number = 50, chapter = 6, part = 648, return_tidytext = TRUE, token = "words", verbose = TRUE)#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>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 [~