dv_time: Plot DV versus time

View source: R/dv_time.R

dv_timeR Documentation

Plot DV versus time

Description

Plot DV versus time

Usage

dv_time(
  df,
  x = pm_axis_time(),
  y = pm_axis_dv(),
  xunit = opts$time.unit,
  yname = "DV",
  group = "ID",
  xs = list(),
  ys = list(),
  log = FALSE,
  xby = NULL,
  ...
)

dv_tafd(df, x = pm_axis_tafd(), ...)

dv_tad(df, x = pm_axis_tad(), ...)

Arguments

df

data frame to plot

x

character name for x-axis data

y

character name for y-axis data

xunit

time units; used to form x-axis label

yname

used to form y-axis label

group

passed to scatt

xs

see defx

ys

see defy

log

if TRUE, y-axis will be log-transformed

xby

interval for x-axis breaks

...

passed to scatt

Details

Plots are generated using y_time, which then calls scatt.

Since this function creates a scatter plot, both the x and y columns must be numeric.

If the data set includes a BLQ column, the values in the y column are set to NA when BLQ is not equal to 0.

Value

A single plot.

Examples

df <- pmplots_data_obs()

dv_time(df, yname="MyDrug (ng/mL)")

dv_time(df, yname="MyDrug (ng/mL)", xunit="day")


# Add a rug

df <- pmplots_data()

dv_time(df) + geom_rug(data = ~ dplyr::filter(.x,BLQ > 0))


metrumresearchgroup/pmplots documentation built on Oct. 15, 2024, noon