This function downloads the FAERS data for selected years and quarters.

faers_download(years, quarters, format = NULL, dir = getwd(), ...)

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.

...

Extra handle options passed to each request multi_download.

Value

An atomic character for the path of downloaded files.

Examples

# you must change `dir`, as the file included in the package is sampled
# in this way, the file will downloaded from FAERS
faers_download(
    year = 2004, quarter = "q1",
    dir = system.file("extdata", package = "faers")
)
#> Finding 1 file already downloaded: aers_ascii_2004q1.zip
#> [1] "/home/wzy/R/x86_64-pc-linux-gnu-library/4.5/faers/extdata/aers_ascii_2004q1.zip"