acled_transform_longer: Transform ACLED data from wide to long

View source: R/acled_transform_longer.R

acled_transform_longerR Documentation

Transform ACLED data from wide to long

Description

Function to convert your ACLED's API calls (if dyadic) into desired monadic forms.

Usage

acled_transform_longer(data, type = "full_actors")

Arguments

data

dataframe or tibble containing your dataset.

type

character string. One of five types: full_actors, main_actors, assoc_actors, source, or all.

  • full_actors: All actor and associated actor columns

  • main_actors: Actor 1 and Actor 2 columns

  • assoc_actors: All associated actor columns

  • source: The source column becomes monadic

Value

A tibble with the data transformed into long form.

See Also

Other Data Manipulation: acled_transform_interaction(), acled_transform_wider()

Examples

## Not run: 
# 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,
#                                            type = "full_actor") # Transforming the data

# nrow(argen_acled_long_actors) # Number of rows in the dataset
# [1] 263 # Long form

# nrow(argen_acled) ) # Number of rows in the dataset
# [1] 145 # Wide form

## End(Not run)

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