rr_register: Download a register

Description Usage Arguments Value Examples

Description

Downloads a whole register (or reads it from a file) and constructs an object that can be interrogated for its records, entries, items, schema, links to other registers, etc.

You should probably run rr_snapshot() on the output before using it.

Usage

1
2
3
rr_register(name = NULL, phase = c("beta", "alpha", "discovery"),
  file = NULL, write = FALSE, dest_path = NULL, parse_datetimes = FALSE,
  quiet = TRUE)

Arguments

name

Character, the name of the register.

phase

Character, one of "beta", "alpha", and "discovery"

file

Character, file path or URL, passed on to readr::read_lines() if name is not provided.

write

Logical, whether to write the RSF file to disk. If TRUE, either name or dest_path must be provided.

dest_path

Character, path and file name to write the RSF to.

parse_datetimes

Logical, whether to parse ISO8601 strings as datetimes with parsedate::parse_iso_8601(), otherwise leave as a string. Partial datetimes are parsed as the earliest possible datetime, e.g. "2018" becomes "2018-01-01 UTC".

quiet

Logical, if TRUE does not print messages to the console.

Value

An S3 object of class register

Examples

1
2
3
4
5
6
rr_register("country")
rr_register("country", "beta")
path <- tempfile()
download.file("https://country.register.gov.uk/download-rsf", path)
rr_register(file = path)
unlink(path)

openregister/RegistersClientR documentation built on May 23, 2019, 9:03 p.m.