Learn R Programming

acledR (version 0.1.0)

acled_transform_interaction: Change interaction codes from numeric labels to string labels

Description

This function allows users to change from numeric interaction codes (i.e. 1, 2, 3, etc) to string interaction codes (i.e. State Forces, Rebel Group, etc.)

Usage

acled_transform_interaction(df, only_inters = FALSE)

Value

Returns a tibble of of ACLED events with modified inter1, inter2 and potentially interaction columns .

Arguments

df

dataframe. ACLED data including at least inter1, inter2 columns. If only_inters is TRUE, it also requires interaction column.

only_inters

boolean. Option whether to include the interaction column in the transformation (if TRUE) or to only use inter1 and inter2 (if FALSE).

See Also

Other Data Manipulation: acled_transform_longer(), acled_transform_wider()

Examples

Run this code
if (FALSE) {

# Load data frame
argen_acled <- acled_api(
  email = "your_email", key = "your_key",
  country = "Argentina", start_date = "2022-01-01", end_date = "2022-02-01",
  acled_access = FALSE
)

# Transform the interactions
argen_acled_transformed <- acled_transformation_interaction(argen_acled, only_inters = F)
}

Run the code above in your browser using DataLab