Learn R Programming

expirest (version 0.1.6)

get_vlines: Prepare vertical lines

Description

The function get_vlines() prepares a data frame for putting vertical lines on a plot prepared by the ggplot() function from the ‘ggplot2’ package.

Usage

get_vlines(model, rl_index = NULL, mtbs = "verified")

Value

A data frame with the columns ‘Time’, Item, Colour and Type is returned, where the column name ‘Time’ is a placeholder for the corresponding variable name. If model is an ‘expirest_osle’

object, the data frame has one row representing the POI obtained from ordinary shelf life estimation. If model is an ‘expirest_wisle’

object, the data frame has two rows representing the POI obtained from ordinary shelf life estimation (row 1) and the POI of the What-if approach for shelf life estimation (row 2).

Arguments

model

An ‘expirest_osle’ or an ‘expirest_Wisle’ object, i.e. a list returned by the expirest_osle() or by the expirest_wisle() function.

rl_index

A positive integer that specifies which of the release limit values that have been handed over to expirest_wisle() should be displayed. The default is NULL.

mtbs

A character string that specifies the “model to be shown”, i.e. either verified, which is the default, or one of cics, dics, dids or dids.pmse. The verified model is the model that was identified through the poolability check. It is thus also one of the possible optional models. The dids model represents the case where a separate model is fitted to the data of each individual batch while the dids.pmse model is the interaction model which includes the \(batch\) variable as main effect and in the interaction term with the \(time\) variable (\(batch \times time\)), i.e. a model where the mean square error is pooled across batches.

Details

The function get_vlines() expects various pieces of information characterising an ‘expirest_osle’ or an ‘expirest_wisle’ model. Based on the information provided, the function prepares a data frame that that is used by the functions plot_expirest_osle() or plot_expirest_wisle()) to put text annotations on the graph that is prepared by these functions.

See Also

plot_expirest_osle, plot_expirest_wisle, ggplot, geom_text.