df <- data.frame(
event_id = c(1, 1, 2, 2, 3),
country = c("US", "US", "UK", "UK", "CA"),
actor1 = c("Actor A", "Actor B", "Actor B", "Actor C", "Actor D"),
deaths_best = c(10, 20, 5, 15, 10)
)
mean_dscore(df, "event_id", c("country", "actor1", "deaths_best"), normalize = TRUE, plot = TRUE)
Run the code above in your browser using DataLab