Read and write a (or a list of) scrapeBill object.

read_scrapeBill(file, subset = NULL)

write_scrapeBill(x, file, aux = "None", ...)

Arguments

file

A connection or the name of the file (use .rds extension).

subset

numeric vector of subset locations if reading only the subset of a list of scrapeBill object.

x

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

aux

Whether to export auxiliary files into separate folder when write_scrapeBill. If "None" (default), do not export any auxiliary file. If "raw", export raw serialized XML vectors. If "html", export HTML files. Set to "raw" or "html" if you want to avoid the .rds file size to become too big (Although the auxiliary files folder size tend to become very big).

...

Additional argument passed to saveRDS

Value

For read_scrapeBill, an R object. For write_scrapeBill, NULL invisibly. If write_scrapeBill writes out auxiliary files under FILENAME_files folder, DON'T delete the folder. read_scrapeBill will need the files in the folder to read file.

See also

Examples

tgturl <- "https://www.congress.gov/bill/116th-congress/senate-bill/252" bill252 <- scrapeBill(tgturl) write_scrapeBill(bill252, "bill252.rds") test <- read_scrapeBill("bill252.rds")