cfr_text {fedregs} | R Documentation |
Extract the Text for a Given Year, Title, Chapter, and Part
Description
cfr_text
returns a tibble of CFR text
Usage
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" |
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.
Value
a tibble with year, title_number, chapter, part, and text nested by subpart
Examples
regs <- cfr_text(year = 2018,
title_number = 50,
chapter = 6,
part = 648,
return_tidytext = TRUE,
token = "words",
verbose = TRUE)
head(regs)