Download and parse FAERS Quarterly Data files

faers(
  years,
  quarters,
  format = NULL,
  dir = getwd(),
  compress_dir = dir,
  handle_opts = list()
)

Arguments

years

An atomic integer indicates years for which data are required.

quarters

An atomic character, only "q1", "q2", "q3", and "q4" are allowed.

format

File format to used, only "ascii" and "xml" are availabe. Default: "ascii".

dir

The destination directory for any downloads. Defaults to current working dir.

compress_dir

A string specifies the directory to extract files to. It will be created if necessary.

handle_opts

Extra handle options passed to each request new_handle.

Value

A FAERSxml or FAERSascii object.

Examples

# you must change `dir`, as the file included in the package is sampled
data <- faers(2004, "q1",
    dir = system.file("extdata", package = "faers"),
    compress_dir = tempdir()
)
#> Finding 1 file already downloaded: aers_ascii_2004q1.zip