Reshape Events DF

reshape_events_df(
  df,
  df_format = c("wide", "long"),
  id_column = NULL,
  dictionary_key,
  dictionary_gender = c("male", "female", "average")
)

Arguments

df

dataframe of events

df_format

whether your events dataframe is wide (a column for actor, behavior, and object) or long (multiple rows for each event)

id_column

if your df is in long format, you must supply the column that identifies the individual event

dictionary_key

the actdata dictionary key you are using for your analysis

dictionary_gender

the gender EPA ratings you are using for your analysis. Should be male, female, or average

Value

a dataframe in the format necessary for applying main ACT functions to the events:

Examples


d <- tibble::tibble(actor = "ceo", behavior = "advise", object = "benefactor")
reshape_events_df(df = d, df_format = "wide", dictionary_key = "usfullsurveyor2015", dictionary_gender = "average")
#> Joining, by = c("term", "component")
#> # A tibble: 9 × 7
#> # Groups:   event_id [1]
#>   event_id element  term       component event                 dimension estim…¹
#>      <int> <chr>    <chr>      <chr>     <chr>                 <chr>       <dbl>
#> 1        1 actor    ceo        identity  ceo advise benefactor E            0.71
#> 2        1 actor    ceo        identity  ceo advise benefactor P            3.22
#> 3        1 actor    ceo        identity  ceo advise benefactor A            1.48
#> 4        1 behavior advise     behavior  ceo advise benefactor E            2.57
#> 5        1 behavior advise     behavior  ceo advise benefactor P            2.28
#> 6        1 behavior advise     behavior  ceo advise benefactor A            0.28
#> 7        1 object   benefactor identity  ceo advise benefactor E            1.97
#> 8        1 object   benefactor identity  ceo advise benefactor P            1.98
#> 9        1 object   benefactor identity  ceo advise benefactor A            0.1 
#> # … with abbreviated variable name ¹​estimate