Skip to contents

The $optimal_behavior() method does this and that..

Usage

optimal_behavior(x, who = c("actor", "object"))

Arguments

x

an "Event deflection" object created by the $deflection() method

who

(character) either "actor" or "object"

Value

a data frame of EPA profiles for the optimal behavior

Examples

act <- interact()
#>  dictionary = list(dataset = "usfullsurveyor2015", group = "all")
#>  equations = list(key = "us2010", group = "all")

events <- rbind(
  data.frame(A = "ceo", B = "rescue", O = "baby"),
  data.frame(A = "ceo", B = "torment", O = "baby")
)

d <- act$deflection(events)
d
#> # Event deflection
#> # A data frame: 2 × 4
#>   A     B       O     deflection
#> * <chr> <chr>   <chr>      <dbl>
#> 1 ceo   rescue  baby        4.44
#> 2 ceo   torment baby       50.1 
act$optimal_behavior(d, who = "actor")
#> # A tibble: 2 × 3
#>       Be    Bp    Ba
#>    <dbl> <dbl> <dbl>
#> 1  0.901  2.17  1.18
#> 2 -1.32   1.51  1.24
act$optimal_behavior(d, who = "object")
#> # A tibble: 2 × 3
#>        Be     Bp    Ba
#>     <dbl>  <dbl> <dbl>
#> 1 -0.0353 -0.821 0.484
#> 2 -0.167   1.11  0.443