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.
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
)
Tibble with updated ACLED data and a newer timestamp.
The dataframe to update, it has to have the same structure as ACLED's dyadic dataframe (i.e. the result of acled_api()
)
The first date of events you want to update from.. These are the celling and floor of event_date, not of timestamp.
The last date of events you want to update from. These are the celling and floor of event_date, not of timestamp.
string. Additional additional_countries to update your dataset. It defaults to “current countries”, which includes all the additional_countries inside your dataset.
string. The regions for which you would like events in your dataset updated.
string. The event types for which you would like events in your dataset updated.
logical. If you have already used acled_access()
, you can set this option as TRUE (default) to avoid having to input your email and access key.
character string. Email associated with your ACLED account registered at https://developer.acleddata.com.
character string. Access key associated with your ACLED account registered at https://developer.acleddata.com.
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.
logical. If TRUE (default), the function will also remove deleted events using acled_deletions_api().
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.
ACLED Keeping your dataset updated guide. https://acleddata.com/download/35179/
Other API and Access:
acled_access()
,
acled_api()
,
acled_deletions_api()
if (FALSE) {
# 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
)
}
Run the code above in your browser using DataLab