Another season, another release. {survivoR} v2.3.5 now on CRAN

[This article was first published on R Archives - Dan Oehm | Gradient Descending, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Survivor 47 has wrapped up and the data has been add to the package. There are a bunch of new things from new datasets to convenience functions to help with analysis. They are functions I use all the time, and I thought I’d add them to the core package.

Head to Github for more details and how to install.

New data

castaway_scores contains details on castaway performance. There are three score types: challenge scores (for all challenge categories), vote history scores, and advantage scores. Higher the score the better. It also includes other vote history and advantage stats, e.g. the number of advantages played.

There is one record per player per season.

add_*() functions

The add_*() functions add a new column(s) to the input data frame. It means you don’t really have to think about adding on the data you need after wrangling the data.

  • add_alive(): Adds a logical flag if the castaway is alive at the start or end of an episode
  • add_bipoc(): Adds a BIPOC to the data frame. If any African American (or Canadian), Asian American, Latin American, or Native American is TRUE then BIPOC is TRUE.
  • add_castaway(): Adds castaway to a data frame. Input data frame must have castaway_id.
  • add_demogs(): Add demographics that includes age, gender, race/ethnicity, and LGBTQIA+ status to a data frame with castaway_id.
  • add_finalist(): Adds a winner flag to the data set.
  • add_full_name(): Adds full name to the data frame. Useful for plotting and making tables.
  • add_gender(): Adds gender to a data frame
  • add_jury(): Adds a jury member flag to the data set.
  • add_lgbt(): Adds the LGBTQIA+ flag to the data frame.
  • add_result(): Adds the result and place to the data frame.
  • add_tribe(): Adds tribe to a data frame for a specified stage of the game e.g. originalswappedswapped_2, etc.
  • add_tribe_colour(): Add tribe colour to the data frame. Useful for preparing the data for plotting with ggplot2.
  • add_winner(): Adds a winner flag to the data set.

filter_*() functions

Similarly, the filter_*() functions are convenience functions to filter the input data. Typically the combine an add_*() function with a follow-up filter step.

  • filter_alive(): Filters a given dataset to those that are still alive in the game at the start or end of a user-specified episode.
  • filter_final_n(): Filters to the final n players e.g. the final 5.
  • filter_finalist(): Filters a data set to the finalists of a given season.
  • filter_jury(): Filters a data set to the jury members of a given season.
  • filter_new_era(): Filters a data set to all New Era seasons.
  • filter_us(): Filter a data set to a specified set of US season or list of seasons. A shorthand version of filter_vs() for the US seasons.
  • filter_vs(): Filters a data set to a specified version season or list of version seasons.
  • filter_winner(): Filters a data set to the winners of a given season.

See the help docs in the package for examples on how to use.

The post Another season, another release. {survivoR} v2.3.5 now on CRAN appeared first on Dan Oehm | Gradient Descending.

To leave a comment for the author, please follow the link and comment on their blog: R Archives - Dan Oehm | Gradient Descending.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)