plotSurvGenderSeverity: Plot of Kaplan-Meier survival curve for all entangled whales.

View source: R/plotSurvGenderSeverity.R

plotSurvGenderSeverityR Documentation

Plot of Kaplan-Meier survival curve for all entangled whales.

Description

plotSurvGenderSeverity returns a plot of survivorship be severity and gender

Usage

plotSurvGenderSeverity(kmlines, censTicks, yearEnd, increment, legendLabs)

Arguments

kmlines

A list with nboot components that contains a data frame in each component. The data frame is the KM curve based on samples of death times for the presumed dead animals. The first component of the list is the median estimate of survivorship. This will be used as the main KM curve. The other components will be used to display uncertainty.

yearEnd

A matrix where each row contains the estimated death times for each animal. Times are in the columns from 1:bnt, which allows for the animal to be alive at the time modelling end.

increment

Scalar representing the temporal unit at which we're showing survival.

legendLabs

Character vector to be used in plotting the legend.

censticks

A list with nboot components that contains a data frame in each component. The data frame contains information on when the animal is censored. The changes in eact iteration, and right now the function is set up to just plot the censored marks from the most probable censored year.

Details

This is a function that will build a ggplot2 object that displays the KM curve along with the times animals get censored. The median estimates of survivorship and censored times are used to make the main line. This comes from the first element of each list that is passed to the function.

The idea behind this function is to show the uncertainty in survivorship that arises from the different estimates of death in each animal.

The main difference from plotSurv is that this breaks out overall survival and produces three lines for each of the three entanglement categories as well as plotting facets for each gender

Value

A ggplot2 object that can be used to create the output plot

Examples

## Not run: 
plotSurvGenderSeverity(kmlines, censTicks, 7)

## End(Not run)

robschick/tangled documentation built on May 9, 2022, 4:07 p.m.