Learn R Programming

expirest (version 0.1.6)

print.plot_expirest_osle: Print a plot illustrating the shelf life estimation (osle)

Description

This is a method for the function print() for objects of class ‘plot_expirest_osle’.

Usage

# S3 method for plot_expirest_osle
print(x, ...)

Value

The ‘plot_expirest_osle’ object passed to the x

parameter is returned invisibly.

Arguments

x

An object of class ‘plot_expirest_osle’ returned by the plot_expirest_osle() function.

...

Further arguments passed to or from other methods or arguments that can be passed down to the formatC() function.

Details

The element Graph of the ‘plot_expirest_osle’ object that is returned by the function plot_expirest_osle() is an object of class ‘ggplot’, generated by the function ggplot() from the ‘ggplot2’ package. Thus, the corresponding plot method is used for plotting. Arguments to the ggplot() function can be passed via the ... parameter.

See Also

expirest_osle, plot_expirest_osle, ggplot(), methods.

Examples

Run this code
# Performing an "ordinary shelf life estimation" (osle)
res1 <-
  expirest_osle(data = exp1[exp1$Batch %in% c("b2", "b5", "b7"), ],
                response_vbl = "Potency", time_vbl = "Month",
                batch_vbl = "Batch", sl = 95, sl_sf = 3,
                srch_range = c(0, 500), sf_option = "loose")

# The 'expirest_osle' object can be passed on to the plot_expirest_osle()
# function. This function does not produce any output but returns a
# 'plot_expirest_osle' object.
if (FALSE) {
  gg1 <- plot_expirest_osle(
    model = res1, response_vbl_unit = "%", x_range = NULL, y_range = c(93, 105),
    mtbs = "verified", plot_option = "full", ci_app = "line")
  gg2 <- print(gg1)

  # The print() function returns the 'plot_expirest_osle' object invisibly.
  class(gg1)
  class(gg2)
}

Run the code above in your browser using DataLab