Title: | Text Analysis of the US Code of Federal Regulations |
---|---|
Description: | The Code of Federal Regulations (CFR) annual edition is the codification of the general and permanent rules published in the Federal Register by the departments and agencies of the Federal Government of the United States of America. Simply, the 'fedregs' package facilitates word processing and sentiment analysis of the CFR using tidy principles. Note: According to the Code of Federal Regulations XML Rendition User Guide Document: "In general, there are no restrictions on re-use of information in Code of Federal Regulations material because U.S. Government works are not subject to copyright. OFR and GPO do not restrict downstream uses of Code of Federal Regulations data, except that independent providers should be aware that only the OFR and GPO are entitled to represent that they are the providers of the official versions of the Code of Federal Regulations and related Federal Register publications." |
Authors: | Scott Large [cre, aut] |
Maintainer: | Scott Large <[email protected]> |
License: | GPL-3 |
Version: | 1.0.0 |
Built: | 2024-11-21 08:26:39 UTC |
Source: | https://github.com/cranhaven/cranhaven.r-universe.dev |
cfr_text
returns a tibble of CFR text
cfr_text(year, title_number, chapter, part, token = "words", return_tidytext = TRUE, verbose = FALSE, ...)
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" |
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.
a tibble with year, title_number, chapter, part, and text nested by subpart
regs <- cfr_text(year = 2018, title_number = 50, chapter = 6, part = 648, return_tidytext = TRUE, token = "words", verbose = TRUE) head(regs)
regs <- cfr_text(year = 2018, title_number = 50, chapter = 6, part = 648, return_tidytext = TRUE, token = "words", verbose = TRUE) head(regs)
fedregs
packageText Analysis of the US Code of Federal Regulations
See the README on GitHub