mk_figure_ind_obs {ruminate}R Documentation

Creates Figures of Individual Observations from PKNCA Result

Description

Takes the output of PKNCA and creates ggplot figures faceted by subject id highlighting of certain NCA aspects (e.g. points used for half-life)

Usage

mk_figure_ind_obs(
  nca_res,
  OBS_LAB = "Concentration ===CONCUNITS===",
  TIME_LAB = "Time ===TIMEUNITS===",
  OBS_STRING = "Observation",
  BLQ_STRING = "BLQ",
  NA_STRING = "Missing",
  log_scale = TRUE,
  scales = "fixed",
  nfrows = 4,
  nfcols = 3
)

Arguments

nca_res

Output of PKNCA.

OBS_LAB

Label of the observation axis with optional ===CONCUNITS=== placeholder for units.

TIME_LAB

Label of the time axis with optional ===TIMEUNITS=== placeholder for units.

OBS_STRING

Label for observation data.

BLQ_STRING

Label for BLQ data.

NA_STRING

Label for missing data.

log_scale

Boolean variable to control y-scale (TRUE: Log 10, FALSE: linear).

scales

String to determine the scales used when faceting. Can be either "fixed", "free", "free_x", or "free_y".

nfrows

Number of facet rows per page.

nfcols

Number of facet cols per page.

Value

List containing the element figures which is a list of figure pages ("Figure 1", "Figure 2", etc.). Each of these is a also a list containing two elements:

Examples

id     = "NCA"
id_UD  = "UD"
id_DW  = "DW"
id_ASM = "ASM"

# We need a state variable to be define
sess_res = NCA_test_mksession(session=list(),
     id     = id,
     id_UD  = id_UD,
     id_DW  = id_DW,
     id_ASM = id_ASM,
     full_session=FALSE)

state = sess_res$state

# Pulls out the active analysis
current_ana = NCA_fetch_current_ana(state)

# This is the raw PKNCA output
pknca_res = NCA_fetch_ana_pknca(state, current_ana)

# Building the figure
mk_res = mk_figure_ind_obs(nca_res = pknca_res)
mk_res$figures$Figure_1$gg

[Package ruminate version 0.2.4 Index]