make_trial_design_table: Create a table describing a simulation trial design.

View source: R/make_trial_design_table.R

make_trial_design_tableR Documentation

Create a table describing a simulation trial design.

Description

Create a table describing a simulation trial design.

Usage

make_trial_design_table(
  existing_exp_details,
  sims_to_include = NA,
  prettify_sim_data_file = NA,
  detail_set = "default",
  prettify_compound_names = TRUE,
  output_type = "flextable",
  include_shading = TRUE,
  font = "Palatino Linotype",
  fontsize = 11,
  column_widths = NA,
  save_table = NA,
  page_orientation = "portrait"
)

Arguments

existing_exp_details

output from running extractExpDetails_mult

sims_to_include

optionally specify which simulation files you want to include.

prettify_sim_data_file

optionally specify what to use for column names instead of, e.g., "abc1a-5mg-sd.xlsx". For example, maybe that particular simulation was from Clinical Study 101, 5 mg cohort. Here's how you could specify that you'd rather see the clinical study name over the simulation file name: prettify_sim_data_file = c("abc1a-5mg-sd.xlsx" = "Clinical Study 101, 5 mg single dose", "abc1a-200mg-qd.xlsx" = "Clinical Study 102, 200 mg QD") This can be a named character vector like that or it can be a data.frame with a column called "File" and a second column called "Annotation". WARNING: This will fail if the names are not unique!

detail_set

optionally specify which details you want. Current options are "default" for a handful of standard columns or "all trial design" to get all possible trial design columns.

prettify_compound_names

TRUE (default) or FALSE on whether to make compound names prettier in the prettified column titles and in any Word output files. This was designed for simulations where the substrate and any metabolites, perpetrators, or perpetrator metabolites are among the standard options for the simulator, and leaving prettify_compound_names = TRUE will make the name of those compounds something more human readable. For example, "SV-Rifampicin-MD" will become "rifampicin", and "Sim-Midazolam" will become "midazolam". Alternatively, set each compound to the name you'd prefer to see in your table if you would like something different. For example, prettify_compound_names = c("Ketoconazole-400 mg QD" = "ketoconazole PO", "StatinX with updated ka" = "superstatin").

output_type

specify what type of output to get. Options:

"flextable" (default)

a nicely formatted table that you can view or insert into an Rmarkdown document

"data.frame"

a data.frame that you can manipulate further in R

"both"

both the nicely formatted flextable and the data.frame

include_shading

TRUE (default) or FALSE for whether to add shading to rows to make things easier to read. If this is set to TRUE, then the rows will be shaded every other row when there's no DDI or by which compound the parameters apply to if there is.

font

font to use. Default is "Arial" and any fonts available on your machine in either Word or PowerPoint should be acceptable. If you get Times New Roman in your table when you asked for something else, it means that that font isn't available or maybe wasn't spelled the way R is expecting it. For example, "Calibri" works but "Calibri (Body)" doesn't even though the latter is listed in PowerPoint and Word.

fontsize

the numeric font size for the output table. Default is 11 point.

column_widths

optionally specify what the widths of the columns should be with a numeric vector of the widths in inches, e.g., column_widths = c(1.5, 2, 0.5, 3)

save_table

optionally save the output table by supplying a file name in quotes here, e.g., "My nicely formatted table.docx". Do not include any slashes, dollar signs, or periods in the file name. If you leave off the file extension, we'll assume you want it to be ".docx". If there is a column titled "File" in your table, we'll add a caption listing which files were included.

page_orientation

set the page orientation for the Word file output to "portrait" (default) or "landscape"

Value

a formatted table and optionally, a saved Word file with that table

Examples

make_trial_design_table(existing_exp_details = MDZdetails,
                        save_table = "MDZ trial design info.docx")


shirewoman2/Consultancy documentation built on Feb. 18, 2025, 10 p.m.