acled_transform_interaction: Change interaction codes from numeric labels to string labels

View source: R/acled_transform_interaction.R

acled_transform_interactionR Documentation

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)

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).

Value

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

See Also

Other Data Manipulation: acled_transform_longer(), acled_transform_wider()

Examples

## Not run: 

# 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)

## End(Not run)

billingtt/acledR documentation built on March 5, 2025, 4:40 p.m.