get_all_comments: Get All Comments for a Specific Docket or Document

View source: R/get-all-comments.R

get_all_commentsR Documentation

Get All Comments for a Specific Docket or Document

Description

This function automates the process of obtaining the metadata, including download links for attachments for all comments corresponding to a specific document or docket ID as multiple API calls will be necessary.

Usage

get_all_comments(endpoint, ..., key = NULL, quiet = TRUE, test = FALSE)

Arguments

endpoint

which endpoint you want the url to be based on. The options are "document", "comment", and "docket". Note that this will be the endpoint your parameters will be applied to (e.g. the posted date of the comment versus the posted date of the document).

...

arguments passed to construct_document_url(), construct_comment_url(), construct_docket_url().

key

the API key passed in the function call; this may be NULL if the user has chosen to set up the key as an environmental variable instead with the function set_datagov_key(). You can use "DEMO_KEY" for a very limited number of calls if needed.

quiet

logical; FALSE if you want to see the progress of the function as it acquires detailed information for each comment. This is recommended if you are obtaining more than 500 comments, since this call will take over an hour to run due to rate limits for the API.

test

logical; to test if the output is as expected without using up many API calls.

Value

a data frame containing the comment metadata, including the download links

Examples

## Not run: 
# retrieve all comments for docket CMS-2014-0063
comments_CMS_2014_0063 <- get_all_comments(endpoint = "document",
docketId = "CMS-2014-0063", test = TRUE)

# retrieve all comments for document NIH-2007-0930-0001
comment_metadata <- get_all_comments(endpoint = "document",
documentId="NIH-2007-0930-0001")

# retrieve all comments for documents last modified between 2021-04-01 12:00:00 and
# 2021-04-02 12:00:00 with search term 'privacy'
comments <- get_all_comments(endpoint = "document",
lastModifiedDate = c("2021-04-01 12:00:00", "2021-04-02 12:00:00"),
quiet = FALSE, searchTerm = "privacy")

## End(Not run)

q-w-a/regulationsgov documentation built on May 3, 2022, 8:23 p.m.