Skip to contents

Start, new, activate, and extract.

Usage

sttn_activate(x, which)

sttn_start(x, event)

sttn_new(x, event)

sttn_extract(x)

Arguments

x

an R6 "Situation" object created by the define_situation() function.

which

(character) either "agent1" or "agent2."

event

an ABO event.

Value

A modified "Situation" object.

Examples


situation <- define_situation(agent1 = interact(), agent2 = interact())
#>  dictionary = list(dataset = "usfullsurveyor2015", group = "all")
#>  equations = list(key = "us2010", group = "all")
#>  dictionary = list(dataset = "usfullsurveyor2015", group = "all")
#>  equations = list(key = "us2010", group = "all")

df <- situation |>
  sttn_activate("agent1") |>
  sttn_start(list(A = "employer", B = "hurt", O = "employee")) |>
  sttn_activate("agent2") |>
  sttn_new(list(A = "employee", B = "pull_away_from", O = "employer")) |>
  sttn_activate("agent1") |>
  sttn_new(list(A = "employer", B = "confront", O = "employee")) |>
  sttn_extract()

  df$deflection
#> # A tibble: 3 × 7
#>    time agent1 agent2 A        B              O        deflection
#>   <int> <chr>  <chr>  <chr>    <chr>          <chr>         <dbl>
#> 1     0 A      O      employer hurt           employee       43.5
#> 2     1 O      A      employee pull_away_from employer       19.2
#> 3     2 A      O      employer confront       employee       13.3

  df$transients
#> # A tibble: 3 × 15
#>    time agent1 agent2 A      B     O         Ae    Ap    Aa     Be     Bp     Ba
#>   <int> <chr>  <chr>  <chr>  <chr> <chr>  <dbl> <dbl> <dbl>  <dbl>  <dbl>  <dbl>
#> 1     0 A      O      emplo… hurt  empl… -1.79   3.05  1.62 -2.38   2.79   1.55 
#> 2     1 O      A      emplo… pull… empl… -0.486 -1.26 -1.33 -0.472 -0.449 -0.680
#> 3     2 A      O      emplo… conf… empl… -0.662  1.83  1.35 -0.607  1.76   1.28 
#> # ℹ 3 more variables: Oe <dbl>, Op <dbl>, Oa <dbl>