Learn R Programming

survivoR (version 2.3.5)

filter_alive: Filter Alive

Description

Filters a given dataset to those that are still alive in the game at the start or end of a user specified episode.

Usage

filter_alive(df, .ep = NULL, .at = "end")

Value

A data frame filtered to castaways who are alive.

Arguments

df

Input data frame. Must have version_season

.ep

Episode. This will filter the castaways that are still alive at either the start or end of the episode.

.at

Either 'start' or 'end' to filter those who are still alive in the game.

Examples

Run this code

library(survivoR)
library(dplyr)

confessionals |>
  filter_us(47) |>
  filter_alive(12) |>
  group_by(castaway) |>
  summarise(n = sum(confessional_count))

Run the code above in your browser using DataLab