mk_table_nca_params {ruminate} | R Documentation |
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
)
Arguments
nca_res |
Output of PKNCA. |
type |
Type of table to generate. Can be either |
grouping |
How to group columns in tables. Can be either |
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.
|
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 |
text_format |
Either |
notes_detect |
Vector of strings to detect in output tables (example |
max_height |
Maximum height of the final table in inches (A value of |
max_width |
Maximum width of the final table in inches (A value of |
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. |
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
.
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)
# 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