Skip to contents

Observed data and how to show it, as the app's "Overlay Dataset" options: for mvp_plot(), mvp_compare() and mvp_open_in_app().

Usage

mvp_observed(
  data,
  y = "DV",
  cmt = NULL,
  color = NULL,
  median = FALSE,
  median_by = NULL,
  points = TRUE
)

Arguments

data

A NONMEM-style data frame (columns ID, TIME in model time units, and y), or the path of a .csv file (read with mvp_data()).

y

Column to plot.

cmt

Only show rows with these CMT values (e.g. the plasma compartment), as the app's "Filter CMT".

color

Typical subject: colour the data by this column (e.g. "DOSE").

median

Add the median of the data over time.

median_by

Typical subject: one median line per value of this column (e.g. "DOSE").

points

Show the data as points (default) as well as lines.

Value

An mvp_observed object. A plain data frame given as observed is used as mvp_observed(data).

Examples

d <- data.frame(ID = rep(1:2, each = 3), TIME = rep(c(1, 4, 12), 2),
                DV = c(5, 3, 1, 6, 4, 2), CMT = 2, DOSE = c(50, 50, 50, 100, 100, 100))
mvp_observed(d, cmt = 2, median = TRUE)
#> <mvp_observed> DV of 2 subjects, 6 rows (CMT 2) 
#>   Shown as lines + points, median