Collect information regarding subject field of the bill.

collectSubject(x, single = TRUE, progress = FALSE)

Arguments

x

A (or A list of) scrapeBill object created by scrapeBill function.

single

If TRUE (default), the function returns single row output (see below). If FALSE, long format data.frame object with separate subject fields as rows.

progress

If TRUE, show progress bar for the processing of multiple bills.

Value

If single==TRUE, returns data.frame object with following information (single row):

  • Subject_Primary: Primary Subject Field of the Bill

  • SUbject_N: Number of Subject Fields Assigned to the Bill

  • Subject_All: All Subject Fields divided by ";"

If single==FALSE, A data.frame object containing following variables (rows represent each subject filed):

  • ID: Bill ID

  • Subject: Name of Subject Field

  • Rank: The order of subject fields as presented in website. 1 indicates primary subject.

See also

Examples

tgturl <- "https://www.congress.gov/bill/116th-congress/senate-bill/252" bill252 <- scrapeBill(tgturl) collectSubject(bill252)
#> Subject_Primary Subject_N Subject_All #> 1 Private Legislation 1 Private Legislation