add_alive | R Documentation |
Adds a logical flag if the castaway is alive at the start or end of an episode
add_alive(df, .ep, .at = "end")
df |
Data frame. Must contain |
.ep |
Episode to evaluate the flag. |
.at |
Either 'start' or 'end'. If 'start' the flag will indicate who is alive at the start of the episode. If 'end' it will indicate who is alive at the end of the episode i.e. after tribal council. |
A data frame with a new column alive
.
library(survivoR)
library(dplyr)
df <- confessionals |>
filter_us(47) |>
add_alive(12)
df |>
filter(alive) |>
group_by(castaway) |>
summarise(n = sum(confessional_count))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.