acled_update {acledR} | R Documentation |
Updating your ACLED dataset
Description
This function is meant to help you keep your dataset updated, by automatically checking for new and modified events, as well as deleted events (if deleted = TRUE). Note: The function makes new API calls to gather new and modified events.
Usage
acled_update(
df,
start_date = min(df$event_date),
end_date = max(df$event_date),
additional_countries = "current countries",
regions = NULL,
event_types = NULL,
acled_access = TRUE,
email = NULL,
key = NULL,
inter_numeric = FALSE,
deleted = TRUE,
prompts = TRUE
)
Arguments
df |
The dataframe to update, it has to have the same structure as ACLED's dyadic dataframe (i.e. the result of |
start_date |
The first date of events you want to update from.. These are the celling and floor of event_date, not of timestamp. |
end_date |
The last date of events you want to update from. These are the celling and floor of event_date, not of timestamp. |
additional_countries |
string. Additional additional_countries to update your dataset. It defaults to “current countries”, which includes all the additional_countries inside your dataset. |
regions |
string. The regions for which you would like events in your dataset updated. |
event_types |
string. The event types for which you would like events in your dataset updated. |
acled_access |
logical. If you have already used |
email |
character string. Email associated with your ACLED account registered at https://developer.acleddata.com. |
key |
character string. Access key associated with your ACLED account registered at https://developer.acleddata.com. |
inter_numeric |
logical. If FALSE (default), interaction code columns (inter1, inter2, and interaction) returned as strings describing the actor types/interactions. If TRUE, the values are returned as numeric values. Must match the inter type (numeric or string) in the dataframe being updated. |
deleted |
logical. If TRUE (default), the function will also remove deleted events using acled_deletions_api(). |
prompts |
logical. If TRUE (default), users will receive an interactive prompt providing information about their call (additional_countries requested, number of country-days, and number of API calls required) and asking if they want to proceed with the call. If FALSE, the call continues without warning, but the call is split and returns a message specifying how many calls are being made. |
Value
Tibble with updated ACLED data and a newer timestamp.
See Also
ACLED Keeping your dataset updated guide. https://acleddata.com/download/35179/
Other API and Access:
acled_access()
,
acled_api()
,
acled_deletions_api()
Examples
## Not run:
# Updating dataset to include newer data from Argentina
acledR::acled_access(email = "your_email", key = "your_key")
new_argen_dataset <- acled_update(acledR::acled_old_dummy,
additional_countries = "Argentina",
acled_access = TRUE,
prompts = FALSE
)
## End(Not run)