Learn R Programming

ruminate (version 0.3.1)

mk_table_nca_params: Create Tabular Output from PKNCA Results

Description

Create paginated tables from PKNCA to use in reports and Shiny apps.

Usage

mk_table_nca_params(
  nca_res,
  type = "individual",
  grouping = "interval",
  not_calc = "NC",
  obnd = NULL,
  nps = NULL,
  mult_str = "*",
  infinity = "inf",
  digits = NULL,
  text_format = "text",
  notes_detect = NULL,
  max_height = 7,
  max_width = 6.5,
  max_row = NULL,
  max_col = NULL
)

Value

list containing the following elements

  • raw_nca: Raw PKNCA output.

  • isgood: Boolean indicating the exit status of the function.

  • one_table: Dataframe of the entire table with the first lines containing the header.

  • one_body: Dataframe of the entire table (data only).

  • one_header: Dataframe of the entire header (row and body, no data).

  • tables: Named list of tables. Each list element is of the output

  • msgs: Vector of text messages describing any errors that were found. format from build_span.

Arguments

nca_res

Output of PKNCA.

type

Type of table to generate. Can be either "individual" or "summary"].

grouping

How to group columns in tables. Can be either "interval" or "parameter"].

not_calc

Text string to replace NA values with to indicated values were not calculated.

obnd

onbrand reporting object.

nps

NCA parameter summary table with the following columns.

  • parameter: PKNCA Paramter name.

  • text: Name used in text output.

  • md: Name used markdown output.

  • latex: Name used in latex output.

  • description: Verbose textual description of the parameter.

mult_str

Text string to replace * values in units.

infinity

Text string to replace infinity in time intervals in column headers.

digits

Number of significant figures to report (set to NULL to disable rounding)

text_format

Either "md" for markdown or "text" (default) for plain text.

notes_detect

Vector of strings to detect in output tables (example c("NC", "BLQ")).

max_height

Maximum height of the final table in inches (A value of NULL will use 100 inches).

max_width

Maximum width of the final table in inches (A value of NULL will use 100 inches).

max_row

Maximum number of rows to have on a page. Spillover will hang over the side of the page..

max_col

Maximum number of columns to have on a page. Spillover will be wrapped to multiple pages.

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)

# Parameter reporting details from the ruminate configuration
nps  = state[["NCA"]][["nca_parameters"]][["summary"]]

# Building the figure
mk_res = mk_table_nca_params(nca_res = pknca_res, nps=nps, digits=3)
mk_res$tables[["Table 1"]]$ft

Run the code above in your browser using DataLab