Description Usage Arguments Details Value Examples
Returns the count of recalls in the Vehicle Recalls Database based on a model search term.
1 2 3 4 5 6 | count_recall_by_model(
model,
start_year = NULL,
end_year = NULL,
api_key = NULL
)
|
model |
List of model names. |
start_year |
Start of year range (optional). |
end_year |
End of year range (optional). |
api_key |
API access key to use, if not set in environment. |
Queries the Vehicle Recalls Database API by model and returns the count of recalls in the database. The year range of the search can be specified and is based on the manufactured year and not the year a recall occurred.
An API key is required to run the function and query the Vehicle Recalls Database. The key can be acquired at https://tc.api.canada.ca/en/detail?api=VRDB.
The API key can be set in the environment using
Sys.setenv(VRD_API = 'your_API_key_here')
and will be used by the
function, or can be passed into the function using the api_key
argument.
A tibble providing the count of recalls from the Vehicle Recalls.
1 2 3 4 5 6 7 | ## Not run:
count_recall_by_model("civic")
count_recall_by_model(c("Subaru", "Toyota"), start_year = 2008)
API_KEY <- "xxxxxxxxxxx"
count_recall_by_model("Sub", end_year = 2000, api_key = API_KEY)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.