Learn R Programming

ruminate (version 0.3.1)

mk_figure_ind_obs: 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
)

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:

  • gg: A ggplot object for that page.

  • notes: Placeholder for future notes, but NULL now.

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.

Examples

Run this code
# We need a state variable to be define
sess_res = NCA_test_mksession()

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

Run the code above in your browser using DataLab