Version: 0.2.0
Date: 2015-12-22
Title: Client Package for the U.S. Federal Register API
Author: Thomas J. Leeper
Maintainer: Thomas J. Leeper <thosjleeper@gmail.com>
Imports: httr, curl, jsonlite
Description: Access data from the Federal Register API https://www.federalregister.gov/developers/api/v1.
License: GPL-2
URL: https://github.com/rOpenGov/federalregister
BugReports: https://github.com/rOpenGov/federalregister/issues
NeedsCompilation: no
Packaged: 2015-12-22 08:45:47 UTC; Thomas
Repository: CRAN
Date/Publication: 2015-12-22 14:36:58

Client package for the U.S. Federal Register API

Description

Access United States Federal Register data from R.

Author(s)

Thomas J. Leeper

Maintainer: Thomas J. Leeper <thosjleeper@gmail.com>


Get Federal Register Agency Information

Description

Function to get information about all (the default) or, optionally, a single federal agency listed in the Federal Register

Usage

fr_agencies(id=NULL, version='v1', ...)

Arguments

id

An optional numeric or character string containing a Federal Register agency identifying number. If NULL (the default), information about all agencies is returned.

version

The Federal Register API version. Default is 'v1'.

...

Additional arguments passed to GET.

Value

A list containing one or more lists of class fedreg_agency, which contain details about the agency.

Author(s)

Thomas J. Leeper

Examples

## Not run: fr_agencies(538)
## Not run: fr_agencies()

Get Federal Register Metadata

Description

Function to get metadata for one or more Federal Register Documents

Usage

fr_get(docnumber, fields=NULL, version='v1', ...)

Arguments

docnumber

A character vector containing one or more Federal Register document numbers.

fields

A character vector specifying the names of fields to return. See Details.

version

The Federal Register API version. Default is 'v1'.

...

Additional arguments passed to GET.

Details

Allowed values for fields are: abstract, abstract_html_url, action, agencies, agency_names, body_html_url, cfr_references, citation, comments_close_on, correction_of, corrections, dates, docket_id, docket_ids, document_number, effective_on, end_page, excerpts, executive_order_notes, executive_order_number, full_text_xml_url, html_url, json_url, mods_url, page_length, pdf_url, president, public_inspection_pdf_url, publication_date, raw_text_url, regulation_id_number_info, regulation_id_numbers, regulations_dot_gov_info, regulations_dot_gov_url, significant, signing_date, start_page, subtype, title, toc_doc, toc_subject, topics, type, volume.

Value

A list containing one or more objects of class fedreg_document.

Author(s)

Thomas J. Leeper

Examples

## Not run: fr_get("2014-05323")
## Not run: fr_get(c("2014-05323","2014-09343"))

Description

Function to search for entries in the Federal Register

Usage

fr_search(..., fields=NULL, per_page=NULL, page=NULL, 
          order='relevance', version='v1', getopts = NULL)

Arguments

...

Named arguments specifying a search query. See Details.

fields

A character vector specifying the names of fields to return. See Details.

per_page

A numeric value specifying the number of records to return. Default is NULL, which returns 20 results per page. Maximum is 1000.

page

A numeric value specifying the page of results to return.

order

A character string specifying “relevance” (the default), “newest”, “oldest”, or “executive_order_number”.

version

The Federal Register API version. Default is 'v1'.

getopts

Additional arguments passed to GET.

Details

The ... argument should contain named arguments that together constitute a search query. Allowed named arguments are:

term: any character string which will be searched for.

agencies: a character string specifying a federal agency mentioned in the document; multiple agencies arguments can be specified and only one agency should be named with each. The appropriate character strings for agencies arguments can be retrieved from the API Documentation: https://www.federalregister.gov/developers/api/v1.

publication_date: a list containing further named arguments. Allowed values are is (exact date; with a date in “YYYY-MM-DD” format), year (exact year; with a year in “YYYY” format), gte (greater than date; with a date in “YYYY-MM-DD” format), and lte (less than date; with a date in “YYYY-MM-DD” format).

effective_date: a list containing further named arguments. See publication_date, above.

type: a character string containing “RULE” for a Final Rule, “PRORULE” for a Proposed Rule, “NOTICE” for a Notice, or “PRESDOCU” for a Presidential Document; multiple type arguments can be specified and only one type should be named with each.

presidential_document_type: a character string containing “determination”, “executive_order”, “memorandum”, “notice”, or “proclamation”. Multiple presidential_document_type arguments can be specified and only one document type should be named with each.

president: a character string containing the name of the signing President for Presidential document types. One of “william-j-clinton”, “george-w-bush”, or “barack-obama”. Multiple presidential_document_type arguments can be specified and only one president should be named with each.

docket_id: a character string containing the agency docket number associated with an article.

regulation_id_number: a character string containing the Regulation ID Number (RIN) associated with an article.

sections: a character string naming a section of the FederalRegister.gov website. Allowed values are: “money”, “environment”, “world”, “science-and-technology”, “business-and-industry”, and “health-and-public-welfare”. Multiple section arguments can be specified and only one section name should be named with each.

significant: a number 0 for a “Deemed significant” or 1 for “not deemed significant”, per EO 12866.

cfr: a list containing further named arguments: title, a character string containing a title of the Code of Federal Regulations and, optionally, part, a character string specifying a part or part range (eg '17' or '1-50') of the specified CFR title.

near_location: a list containing further named arguments: location, a character string containing a zipcode or city and state and within, a maximum distance from named location in miles.

Allowed values for fields are: abstract, abstract_html_url, action, agencies, agency_names, body_html_url, cfr_references, citation, comments_close_on, correction_of, corrections, dates, docket_id, docket_ids, document_number, effective_on, end_page, excerpts, executive_order_notes, executive_order_number, full_text_xml_url, html_url, json_url, mods_url, page_length, pdf_url, president, public_inspection_pdf_url, publication_date, raw_text_url, regulation_id_number_info, regulation_id_numbers, regulations_dot_gov_info, regulations_dot_gov_url, significant, signing_date, start_page, subtype, title, toc_doc, toc_subject, topics, type, volume.

Value

A list containing one or more objects of class fedreg_document.

Author(s)

Thomas J. Leeper

Examples

## Not run: 
fr_search(presidential_document_type='executive_order',
          fields=c('executive_order_number','president','raw_text_url','document_number'),
          per_page=30)

fr_search(term='climate', publication_date=list(gte='2013-01-01',lte='2013-03-31'))

## End(Not run)

Retrieve Public Inspection Documents

Description

Function to retrieve all current Public Inspection Documents

Usage

pi_current(version='v1', ...)

Arguments

version

The Federal Register API version. Default is 'v1'.

...

Additional arguments passed to GET.

Details

Retrieve all current Public Inspection Documents, those items available to the public prior to publication in the Federal Register.

Value

A list containing one or more objects of class fedreg_document.

Author(s)

Thomas J. Leeper

References

https://www.federalregister.gov/learn/public-inspection-desk-2

Examples

## Not run: pi_current()

Get Public Inspection Metadata

Description

Function to get metadata for one or more Public Inspection Documents

Usage

pi_get(docnumber, version='v1', ...)

Arguments

docnumber

A character vector containing one or more Public Inspection Document document numbers.

version

The Federal Register API version. Default is 'v1'.

...

Additional arguments passed to GET.

Value

A list containing one or more objects of class fedreg_document.

Author(s)

Thomas J. Leeper

References

https://www.federalregister.gov/learn/public-inspection-desk-2

Examples

## Not run: pi_get("2014-10067")
## Not run: pi_get(c("2014-10067","2014-10687"))

Description

Function to search for documents under Public Inspection

Usage

pi_search(..., fields=NULL, per_page=NULL, page=NULL, version='v1', getopts = NULL)

Arguments

...

Named arguments specifying a search query. See Details.

fields

A character vector specifying the names of fields to return. See Details.

per_page

A numeric value specifying the number of records to return. Default is NULL, which returns 20 results per page. Maximum is 1000.

page

A numeric value specifying the page of results to return.

version

The Federal Register API version. Default is 'v1'.

getopts

Additional arguments passed to GET.

Details

The ... argument should contain named arguments that together constitute a search query. Allowed named arguments are:

term: any character string which will be searched for.

agencies: a character string specifying a federal agency mentioned in the document; multiple agencies arguments can be specified and only one agency should be named with each. The appropriate character strings for agencies arguments can be retrieved from the API Documentation: https://www.federalregister.gov/developers/api/v1.

type: a character string containing “RULE” for a Final Rule, “PRORULE” for a Proposed Rule, “NOTICE” for a Notice, or “PRESDOCU” for a Presidential Document. Multiple type arguments can be specified and only one type should be named with each.

special_filing: 0 for a regular filing or 1 for a special filing.

docket_id: an agency docket number associated with article.

Allowed values for fields are: agencies, docket_numbers, document_number, editorial_note, excerpts, filed_at, filing_type, html_url, json_url, num_pages, pdf_file_size, pdf_updated_at, pdf_url, publication_date, raw_text_url, title, toc_doc, toc_subject, type.

Value

A list containing one or more objects of class fedreg_document.

Author(s)

Thomas J. Leeper

References

https://www.federalregister.gov/learn/public-inspection-desk-2

Examples

## Not run: 
pi_search(type='RULE', fields=c('document_number','raw_text_url'))
pi_search(type='PRESDOC')

## End(Not run)