plot_mztia {disprofas}R Documentation

Graphical representation of the of MZTIA estimation

Description

The function plot_mztia() makes a graphical representation of the estimates done by the mztia() function.

Usage

plot_mztia(x, ...)

Arguments

x

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

...

Additional parameters that can be passed on to the ggplot() function.

Details

A graphical representation of the information in the Data element of the object that is returned by mztia() function is made by aid of the ggplot() function from the ‘ggplot2’ package and added as new list element to the mztia object. Ideally, the data frame provided to the mztia() function allows drawing a time course of the % drug release values. If a single time point is available, the tolerance intervals of the groups specified by the grouping parameter (e.g., for the differentiation of batches or formulations of a drug product) are displayed.

Value

An object of class ‘plot_mztia’ is returned invisibly, consisting of the elements of the ‘mztia’ object and an additional element named Graph. The element Graph is a ‘ggplot’ object returned by calling the ggplot() function.

See Also

mztia, ggplot.

Examples

# Analyse the data by aid of the mztia() function.
res1 <- mztia(data = dip1, shape = "wide", tcol = 3:10, grouping = "type",
              reference = "R", cap = FALSE)

# The 'mztia' object can be passed on to the plot_mztia() function. This
# function does not produce any output. It returns a 'plot_mztia' object that
# is essentially an 'mztia' object augmented by a 'ggplot' object.
## Not run: 
  gg1 <- plot_mztia(res1)
  gg1

## End(Not run)

# Since the element gg1$Graph is a 'ggplot' object it can be used for further
# manipulation by aid of 'ggplot2' functions.
## Not run: 
  if (requireNamespace("ggplot2")) {
    library(ggplot2)

    gg1$Graph + labs(title = "Dissolution Data Assessment",
                     x = "Time [min]", y = "Drug Release [%]")
  }

## End(Not run)

# Use a data frame in long format.
res2 <- mztia(data = dip5, shape = "long", tcol = 3, grouping = "type",
             reference = "reference", response = "weight", cap = FALSE,
             QS = c(5, 15) / 100)

## Not run: 
  gg2 <- plot_mztia(res2)
  gg2

  if (requireNamespace("ggplot2")) {
    library(ggplot2)

    gg2$Graph + labs(title = "Tolerance Intervals",
                     x = NULL, y = "Weight [ounces]")
  }

## End(Not run)

[Package disprofas version 0.2.0 Index]