From 7d20ac3efe85d6c5119618718beec09f53b4d95d Mon Sep 17 00:00:00 2001 From: lfagliano <67928839+lfagliano@users.noreply.github.com> Date: Tue, 14 Nov 2023 14:46:56 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20ACLED/ac?= =?UTF-8?q?ledR@d06fcec2548e628b123d295a70e5f63a8437ef3d=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 2 +- LICENSE.html | 2 +- articles/acled_api.html | 21 +++--- articles/acled_codebook.html | 66 ++++++++--------- articles/acled_deletions_api.html | 8 +- articles/acled_rounding.html | 2 +- articles/acled_transformations.html | 86 +++++++++++++--------- articles/acled_update.html | 12 +-- articles/get_started.html | 18 ++--- articles/index.html | 2 +- authors.html | 7 +- index.html | 8 +- pkgdown.yml | 2 +- reference/acledR-package.html | 2 +- reference/acled_access.html | 2 +- reference/acled_api.html | 20 ++--- reference/acled_codebook.html | 2 +- reference/acled_countries.html | 2 +- reference/acled_deletions_api.html | 2 +- reference/acled_event_categories.html | 2 +- reference/acled_interaction_codes.html | 2 +- reference/acled_multipliers.html | 2 +- reference/acled_old_deletion_dummy.html | 2 +- reference/acled_old_dummy.html | 2 +- reference/acled_regions.html | 2 +- reference/acled_rounding.html | 2 +- reference/acled_transform_interaction.html | 5 +- reference/acled_transform_longer.html | 5 +- reference/acled_transform_wider.html | 5 +- reference/acled_update.html | 12 +-- reference/index.html | 7 +- reference/pipe.html | 2 +- search.json | 2 +- sitemap.xml | 3 - 34 files changed, 163 insertions(+), 158 deletions(-) diff --git a/404.html b/404.html index 27dd995..5e7cd5e 100644 --- a/404.html +++ b/404.html @@ -50,7 +50,7 @@ Reference
acled_api(email = NULL,
key = NULL,
- countries = NULL,
+ country = NULL,
regions = NULL,
start_date = "1997-01-01",
end_date = Sys.Date(),
@@ -157,7 +157,7 @@ Parameters for the API
Geographical filters
-You can use the countries
and regions
+
You can use the country
and regions
parameters to specify the locations from which you would like to request
data. If both values are NULL
or are not included, the API
will return data for all countries and regions. If you would like to
@@ -186,9 +186,8 @@
Temporal filtersKeeping
-your datasets up to date page for an acledR
approach or
-this guide more
-relevant to Excel or other spreadsheet tools.
+your datasets up to date
page for an acledR approach or this guide more relevant to
+Excel or other spreadsheet tools.
Additional filters
@@ -277,7 +276,7 @@ Example - Gathering data with <
acled_access(email = "acledexamples@gmail.com", key = "M3PWwg3DIdhHMuDiilp5")
-df_br <- acled_api(countries = c("Brazil"),
+df_br <- acled_api(country = c("Brazil"),
start_date = "2022-01-01",
end_date = "2022-12-01",
monadic = F,
@@ -305,14 +304,14 @@ Example - Gathering data with <
If you wanted data from both “Brazil” and “Colombia”, you would
execute the following:
-df_br_co <- acled_api(countries = c("Brazil", "Colombia"),
+df_br_co <- acled_api(country = c("Brazil", "Colombia"),
start_date = "2022-01-01",
end_date = "2022-12-01",
monadic = F,
acled_access = TRUE,
prompt = F)
If you are interested in events occurring over a larger area, it may
-be simpler to omit the countries
parameter and include a
+be simpler to omit the country
parameter and include a
regions
argument instead. You could also include an
event_type
argument to receive only a specific type of
event:
@@ -329,7 +328,7 @@ Example - Gathering data with <
include the argument as either a string (“yyyy-mm-dd”) or a numeric Unix
timestamp:
-df_br_co <- acled_api(countries = c("Brazil", "Colombia"),
+df_br_co <- acled_api(country = c("Brazil", "Colombia"),
start_date = "2022-01-01",
end_date = "2022-12-01",
monadic = F,
@@ -341,7 +340,7 @@ Example - Gathering data with <
(e.g., “Rioters versus Civilians (57)”), then you can add
interaction code to the ...
argument:
-df_sa <- acled_api(countries = c("Brazil", "Colombia"),
+df_sa <- acled_api(country = c("Brazil", "Colombia"),
start_date = "2022-01-01",
end_date = "2022-12-01",
monadic = F,
diff --git a/articles/acled_codebook.html b/articles/acled_codebook.html
index b4c1ad7..f7abaf5 100644
--- a/articles/acled_codebook.html
+++ b/articles/acled_codebook.html
@@ -52,7 +52,7 @@
Reference
- Get Started
+ Get Started
Utilizing acledR
@@ -98,34 +98,29 @@
-Pages under the ACLED Codebook tab describe the variables in ACLED’s
-data and provide usage examples. Users should consult the complete guide
-summarizing ACLED’s methodology at here for more details on
-each column.
+Pages in the ACLED Codebook tab describe the variables found in
+ACLED’s data, while also providing examples of their use. You can
+consult the complete guide summarizing ACLED’s methodology here for a more thorough
+description of the methodology underlying each column.
ACLED Overview
-The ACLED project codes reported information on the type, agents,
-location, date, and other characteristics of political violence events,
-demonstrations and politically relevant non-violent events (referred to
-as ‘Strategic developments’). ACLED focuses on tracking a range of
-violent and non-violent actions by political agents, including
-governments, rebels, militias, identity groups, political parties,
-external actors, rioters, protesters and civilians.
-Political violence is defined as the use of force by a group with a
-political purpose or motivation. ACLED records political violence
-through its constituent events, the intent of which is to produce a
-comprehensive overview of all forms of political disorder, expressed
-through violence and demonstrations, within and across states. A
-politically violent event is a single altercation where often force is
-used by one or more groups toward a political end, although some
-non-violent instances – including protests and strategic developments –
-are included in the dataset to capture the potential pre-cursors or
-critical junctures of a violent conflict.
+The ACLED project codes and standardizes reported information on the
+type, agents, location, date, and other characteristics of events of
+political violence, demonstrations, and politically relevant non-violent
+events (referred to as ‘Strategic developments’). ACLED focuses on
+tracking a range of violent and non-violent actions by political agents,
+including governments, rebels, militias, identity groups, political
+parties, external actors, rioters, protesters and civilians.
The fundamental unit of observation in ACLED is the event.
Events involve designated actors – e.g. a named rebel group, a militia
or state forces. They occur at a specific named location (identified by
-name and geographic coordinates) and on a specific day.
+name and geographic coordinates) and on a specific day. For more
+information on what qualifies as an event, and how ACLED codes
+long-running conflicts, please see our knowledge
+base. Every event is described by information in a standardized set
+of columns comprising ACLED’s core dataset. Below you can find a brief
+description of each column.
Column List
@@ -510,23 +505,24 @@ Column List
ACLED Help
-To better understand what each column in our dataset represents,
-acledR::acled_help()
redirects you to relevant
-documentation for the column in question.
+Rather than referring to this table during coding, and to provide a
+deeper understanding of a column’s meaning, you can use the
+acledR::acled_help()
function. This function will redirect
+you to the relevant documentation for the column in question.
acled_help(column = NULL)
-The function is very straightforward, only requiring one argument.
-column
refers to the column which users may be interested
-on exploring further.
+The function is very straightforward, requiring only one argument.
+column
refers to the column for which you would like to be
+provided with more information.
Note: acled_help()
only supports one
column at a time.
For example, if you would like to know more about the
-fatalities column, you can write
-acled_help(column="fatalities")
which will prompt a
-fatalities vignette in the RStudio Help pane.
-While some columns have an standalone documentation vignette,
-e.g. Fatalities; others may be part of another vignette, e.g. admins are
-in the geographical vignette.
+fatalities column, you can
+runacled_help(column="fatalities")
, prompting the
+fatalities vignette to appear in the RStudio Help pane.
+While some columns have their own vignette, e.g. fatalities; others
+may be grouped together with documentation of similar columns,
+e.g. admins are in the geographical vignette.
- Get Started
+ Get Started
Utilizing acledR
@@ -155,7 +155,7 @@ Keeping check of updates -
acled_update(
df,
- countries = NULL,
+ additional_countries = NULL,
regions = NULL,
event_types = NULL,
acled_access = TRUE,
@@ -228,14 +228,14 @@ Examples additional_countries = "Argentina",
acled_access = T,
prompts = FALSE)
-## Requesting data for 1 countries. Accounting for the requested time period and ACLED coverage dates, this request includes approximately 350 events.
+## Requesting data for 1 country. Accounting for the requested time period and ACLED coverage dates, this request includes approximately 350 events.
## Processing API request
## Extracting content from API request
## Dataset updated.
## Old number of events: 326.
## New events: 1.
## Deleted events: 0.
-## Total new & modified events: 64
+## Total new & modified events: 67
Now your dataset captures modified and newly created events.
Best of luck!
diff --git a/articles/acled_rounding.html b/articles/acled_rounding.html
index 2ad3ec2..524e602 100644
--- a/articles/acled_rounding.html
+++ b/articles/acled_rounding.html
@@ -52,7 +52,7 @@
Reference
- Get Started
+ Get Started
Utilizing acledR
diff --git a/articles/acled_transformations.html b/articles/acled_transformations.html
index 2413c23..fb86f20 100644
--- a/articles/acled_transformations.html
+++ b/articles/acled_transformations.html
@@ -52,7 +52,7 @@
Reference
- Get Started
+ Get Started
Utilizing acledR
@@ -112,26 +112,24 @@ 2022-11-11
1. Switch between numeric and string interaction codes -
acled_transform_interactions()
-The first functions you can find in this suite of data manipulation,
+
The first function in this suite,
acled_transform_interactions()
, allows you to easily
-transition from numeric interaction codes to string-based interaction
-codes.
-In our documentation, we often refer to actor types by using
-string-based categories (e.g. State Forces or Rebel
-Groups), while our dataset structures these categories using a
-numeric categorization. You can find more information, including a table
-of which actor categories correspond to which numeric codes, in ACLED’s
-codebook.
-This function allows you to convert your numeric codes into
-string-based categories, without the time-consuming need of writing out
-these changes yourself.
-
-acled_transform_interactions(df,
+transition from numeric interaction codes to a text description of the
+interaction code.
+In our analyses, we often refer to actor types by using text
+categories (e.g. State Forces or Rebel Groups), while
+our dataset structures these categories using a numeric categorization.
+You can find more information - including a table of which actor
+categories correspond to which numeric codes – in ACLED’s codebook.
+This function allows you to convert your numeric codes into text
+descriptions, without the time-consuming need of writing out these
+changes yourself.
+acled_transform_interactions(df,
only_inters = F)
The function requires two arguments:
-data
: An ACLED dataset which includes inter1 and
-inter2 (when only_inter = F
).
+data
: An ACLED dataset which includes the inter1 and
+inter2 variables (when only_inter = F
).
only_inters
: Boolean option on whether to include
only inter1 and inter2, without including
interaction. This option defaults to FALSE
, thus
@@ -139,7 +137,27 @@
+acledR::acled_old_dummy[39:40,] %>%
+ # Displaying only relevant columns
+ select(event_id_cnty, inter1, inter2, interaction)
+## # A tibble: 2 × 4
+## event_id_cnty inter1 inter2 interaction
+## <chr> <dbl> <dbl> <dbl>
+## 1 ARG10606 6 0 60
+## 2 ARG10605 5 1 15
+
… will change to …
+
+acledR::acled_old_dummy[39:40,] %>%
+ acled_transform_interaction()%>%
+ select(event_id_cnty, inter1, inter2, interaction)%>%
+ head(2)
+## # A tibble: 2 × 4
+## event_id_cnty inter1 inter2 interaction
+## <chr> <chr> <chr> <chr>
+## 1 ARG10606 Protesters NA Sole Protesters
+## 2 ARG10605 Rioters State Forces State Forces-Rioters
2. From wide to long formats -
@@ -151,15 +169,15 @@ 2. From wide to long
row (see our API
interactive guide for a more detailed explanation). This format
generally works well if you are interested in conducting event-based
-analyses. However, for example, you may wish to conduct actor-based
-analyses that are better suited to a long data format where each actor
-has a separate row, and a single event may therefore be represented in
-multiple rows.
+analyses. Still, there are times when you may wish to conduct
+actor-based analyses that are better suited to a long data format where
+each actor has a separate row, and a single event may therefore be
+represented in multiple rows.
Note that wide and long formats are generic terms that are more
specifically referred to as dyadic and monadic data types in other ACLED
documentation (see ACLED
endpoint guide).
-
+
acled_transform_longer(data,
type = "full_actors")
acled_transform_longer()
requires two arguments:
@@ -185,7 +203,7 @@ 2. From wide to long
code came from the inter1 or inter2 column.
main_actors
: Transposes only actor1 and
actor2. There will be separate rows for main actors only. This
-generates two new columns: type_of_act or
and
+generates two new columns: type_of_actor
and
actor
. type_of_actor
denotes the column in
which the actor was originally found, while actor
is simply
the name of the actor.
@@ -203,8 +221,8 @@ 2. From wide to long
column.
Keep in mind that you can receive some data in monadic/longer form
-directly from ACLED’s API, but using this function can provide some
-added benefits. Specifically:
+directly from ACLED’s API, but using this function instead can provide
+some added benefits. Specifically:
You can use this function to transform a dyadic/wide dataset to a
monadic/long dataset, thus receiving the latter without executing an
@@ -228,7 +246,7 @@
From long to wide form
aid users that may have used acled_transform_longer()
and
would like to return the dataframe to its original state.
The function is similar to its counterpart:
-
+
acled_transform_wider(data,
type = "full_actors")
As you can see, the arguments are the same as those for
@@ -249,25 +267,25 @@
Example
and key values below are only examples. You should provide your own
credentials that you can create by using ACLED’s
website.
-
+
library(acledR)
acled_access(email = "acledexamples@gmail.com", key = "M3PWwg3DIdhHMuDiilp5")
## Success! Credentials authorized
-
+
df_sa <- acled_api(regions = "South America",
start_date = "2023-01-01",
end_date = "2023-06-01",
monadic = F,
acled_access = TRUE,
prompt = F)
-## Requesting data for 13 countries. Accounting for the requested time period and ACLED coverage dates, this request includes approximately 14,693 events.
+## Requesting data for 13 country. Accounting for the requested time period and ACLED coverage dates, this request includes approximately 14,693 events.
## Processing API request
## Extracting content from API request
Now that your data are in long format with one actor per row, you can
much more easily filter the data to retain only those events involving
the “Military Forces of Colombia (2022-)”:
-
+
mil_colombia <- df_sa %>%
filter(stringr::str_detect(paste(actor1,actor2,assoc_actor_1, assoc_actor_2, sep = ";"), "Military Forces of Colombia (2022-)"))
In the filtered events there are 0 rows, meaning there were 0 events
@@ -281,7 +299,7 @@
Example
solution is to transform the dataset into long form and then calculate
event counts for each actor. You can begin by using the
acled_transform_longer()
function:
-
+
df_sa_long <- acled_transform_longer(df_sa, type = "full_actors")
## Be aware, inter1 and inter2 represent the actor type of actor1 and actor2 respectively.
The dataset is now in long form with each row representing a single
@@ -291,7 +309,7 @@
Example
identifiers because when transforming data to long format, events can be
represented in multiple rows equal to the number of actors involved in
that event.
-
+
library(tidyr)
library(dplyr)
@@ -300,7 +318,7 @@ Example
summarise(n_events = n_distinct(unique(event_id_cnty)))
To verify your results, you can filter actor counts to only “Military
Forces of Colombia (2022-)”.
-
+
diff --git a/articles/acled_update.html b/articles/acled_update.html
index 13c7169..1be2278 100644
--- a/articles/acled_update.html
+++ b/articles/acled_update.html
@@ -52,7 +52,7 @@
Reference
-
Utilizing acledR
@@ -158,14 +158,16 @@
Keeping track of updates -
acled_update(
df,
- additional_countries = NULL,
+ 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,
deleted = TRUE,
- prompts = T)
+ prompts = TRUE)
The function has the following arguments:
df
: The dataframe to update. It has to have the same
@@ -236,14 +238,14 @@
Examples additional_countries = "Argentina",
acled_access = T,
prompts = FALSE)
-## Requesting data for 1 countries. Accounting for the requested time period and ACLED coverage dates, this request includes approximately 350 events.
+## Requesting data for 1 country. Accounting for the requested time period and ACLED coverage dates, this request includes approximately 350 events.
## Processing API request
## Extracting content from API request
## Dataset updated.
## Old number of events: 326.
## New events: 1.
## Deleted events: 0.
-## Total new & modified events: 64
+## Total new & modified events: 67
Now your dataset captures modified and newly created events.
Best of luck!
diff --git a/articles/get_started.html b/articles/get_started.html
index 9645049..9881d82 100644
--- a/articles/get_started.html
+++ b/articles/get_started.html
@@ -51,8 +51,8 @@
--
+ Get Started
Transforming ACLED Data - acled_transform_*
diff --git a/articles/index.html b/articles/index.html
index 8385f0b..ae3c666 100644
--- a/articles/index.html
+++ b/articles/index.html
@@ -28,7 +28,7 @@
Reference
+devtools::install_github("ACLED/acledR")
Installation (for public use)
Until the acledR package gets added into the Comprehensive R Archive Network (CRAN), users can utilize devtools to install the package from Github. Thankfully, the installation is rather simple. You can install it through the following code:
-devtools::install_github("billingtt/acledR") ## if you are interested in a particular branch, please add a 'ref' argument.
+devtools::install_github("ACLED/acledR") ## if you are interested in a particular branch, please add a 'ref' argument.
@@ -176,7 +176,7 @@ Developers
diff --git a/pkgdown.yml b/pkgdown.yml
index 1897060..4fe79ee 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -9,7 +9,7 @@ articles:
acled_transformations: acled_transformations.html
acled_update: acled_update.html
get_started: get_started.html
-last_built: 2023-10-25T18:53Z
+last_built: 2023-11-14T14:44Z
urls:
reference: https://acled.github.io/acledR/reference
article: https://acled.github.io/acledR/articles
diff --git a/reference/acledR-package.html b/reference/acledR-package.html
index c90e0d1..f040785 100644
--- a/reference/acledR-package.html
+++ b/reference/acledR-package.html
@@ -30,7 +30,7 @@
Reference
This function allows users to easily request data from the ACLED API. Users can include variables such as countries, regions, dates of interest and the type of file (monadic or dyadic). The function returns a tibble of the desired ACLED events.
+This function allows users to easily request data from the ACLED API. Users can include variables such as country, regions, dates of interest and the type of file (monadic or dyadic). The function returns a tibble of the desired ACLED events.
acled_api(
email = NULL,
key = NULL,
- countries = NULL,
+ country = NULL,
regions = NULL,
start_date = floor_date(Sys.Date(), "year") - years(1),
end_date = Sys.Date(),
@@ -95,12 +95,12 @@ Argumentshttps://developer.acleddata.com.
-countries
-character vector. Default is NULL, which will return events for all countries. Pass a vector of country names to retrieve events from specific countries. The list of ACLED country names may be found via acledR::acled_countries.
+country
+character vector. Default is NULL, which will return events for all countries. Pass a vector of countries names to retrieve events from specific countries. The list of ACLED countries. names may be found via acledR::acled_countries.
regions
-vector of region names (character) or region codes (numeric). Default is NULL, which will return events for all regions. Pass a vector of regions names or codes to retrieve events from countries within specific regions. The list of ACLED regions may be found via acledR::acled_regions.
+vector of region names (character) or region codes (numeric). Default is NULL, which will return events for all regions. Pass a vector of regions names or codes to retrieve events from countries. within specific regions. The list of ACLED regions may be found via acledR::acled_regions.
start_date
@@ -132,7 +132,7 @@ ArgumentsValue
See also
-ACLED API guide. https://acleddata.com/acleddatanew//wp-content/uploads/dlm_uploads/2021/11/API-User-Guide_Feb2022.pdf
+ACLED API guide. https://apidocs.acleddata.com/
Other API and Access:
acled_access()
,
acled_deletions_api()
,
@@ -162,7 +162,7 @@
Examples# Get all the events coded by ACLED in Argentina from 01/01/2022 until 02/01/2022
# in dyadic-wide form
argen_acled <- acled_api(email = jane.doe.email, key = jane.doe.key,
- countries = "Argentina", start_date = "2022-01-01", end_date="2022-02-01",
+ country = "Argentina", start_date = "2022-01-01", end_date="2022-02-01",
acled_access = FALSE)
# tibble with all the events from Argentina where each row is one event.
diff --git a/reference/acled_codebook.html b/reference/acled_codebook.html
index 1ba28e4..75c10ed 100644
--- a/reference/acled_codebook.html
+++ b/reference/acled_codebook.html
@@ -28,7 +28,7 @@
Reference
@@ -101,7 +100,7 @@ Examples
# Load data frame
argen_acled <- acled_api(email = jane.doe.email, key = jane.doe.key,
- countries = "Argentina", start_date = "2022-01-01", end_date="2022-02-01",
+ country = "Argentina", start_date = "2022-01-01", end_date="2022-02-01",
acled_access = FALSE)
# Transform the interactions
diff --git a/reference/acled_transform_longer.html b/reference/acled_transform_longer.html
index a9f2328..0cc3fdc 100644
--- a/reference/acled_transform_longer.html
+++ b/reference/acled_transform_longer.html
@@ -28,7 +28,7 @@
Reference
- Get Started
+ Get Started
Utilizing acledR
@@ -94,7 +94,6 @@ Value
See also
Other Data Manipulation:
-acled_filter_actors()
,
acled_transform_interaction()
,
acled_transform_wider()
if (FALSE) {
-#argen_acled <- acled_api(countries = "Argentina",start_date = "2022-01-01",
+#argen_acled <- acled_api(country = "Argentina",start_date = "2022-01-01",
# end_date="2022-02-01", acled_access = T, prompt = F)
#argen_acled_long_actors <- acled_transform_wide_to_long(argen_acled,
diff --git a/reference/acled_transform_wider.html b/reference/acled_transform_wider.html
index 270e38c..2fc920d 100644
--- a/reference/acled_transform_wider.html
+++ b/reference/acled_transform_wider.html
@@ -28,7 +28,7 @@
Reference
- Get Started
+ Get Started
Utilizing acledR
@@ -95,7 +95,6 @@ Value
See also
Other Data Manipulation:
-acled_filter_actors()
,
acled_transform_interaction()
,
acled_transform_longer()
if (FALSE) {
-#argen_acled <- acled_api(countries = "Argentina",start_date = "2022-01-01",
+#argen_acled <- acled_api(country = "Argentina",start_date = "2022-01-01",
# end_date="2022-02-01", acled_access = T, prompt = F)
#argen_acled_long_actors <- acled_transform_longer(argen_acled,
# type = "full_actor") # Transforming the data to long form
diff --git a/reference/acled_update.html b/reference/acled_update.html
index 7c290ef..8e05338 100644
--- a/reference/acled_update.html
+++ b/reference/acled_update.html
@@ -30,7 +30,7 @@
Reference
- Get Started
+ Get Started
Utilizing acledR
@@ -75,14 +75,14 @@ Usage
df,
start_date = min(df$event_date),
end_date = max(df$event_date),
- additional_countries = "current additional_countries",
+ additional_countries = "current countries",
regions = NULL,
event_types = NULL,
acled_access = TRUE,
email = NULL,
key = NULL,
deleted = TRUE,
- prompts = T
+ prompts = TRUE
)
acled_transform_interaction()