Read and Parse Drugs@FDA data

fda_drugs(pattern = "Products", url = NULL, list = FALSE, force = FALSE)

Arguments

pattern

File pattern to use. Must define a file exactly, you can set list = TRUE to see what files can be used.

url

A string of the url for Drugs@FDA file. Try to get the link from site: https://www.fda.gov/drugs/drug-approvals-and-databases/drugsfda-data-files.

list

A boolean value, should it only list files in the Drugs@FDA dataset?

force

A boolean value. If set to TRUE, it indicates the retrieval of Drugs@FDA data in the FDA directly, bypassing the cache.

Value

  • if list = TRUE, an atomic character.

  • if list = FALSE, a data.table.

Examples

if (FALSE) { # \dontrun{
fda_drugs(list = TRUE)
fda_drugs()
} # }