add_alive {survivoR} | R Documentation |
Adds alive flag
Description
Adds a logical flag if the castaway is alive at the start or end of an episode
Usage
add_alive(df, .ep, .at = "end")
Arguments
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. |
Value
A data frame with a new column alive
.
Examples
library(survivoR)
library(dplyr)
df <- confessionals |>
filter_us(47) |>
add_alive(12)
df |>
filter(alive) |>
group_by(castaway) |>
summarise(n = sum(confessional_count))
[Package survivoR version 2.3.6 Index]