add_alive: Adds alive flag

View source: R/add.R

add_aliveR 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 version_season and castaway.

.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))

survivoR documentation built on April 3, 2025, 5:34 p.m.