View source: R/format_table_simple.R
format_table_simple | R Documentation |
format_table_simple
is meant to for use with writing compound summary
files. It is a wrapper function for formatTable_Simcyp that creates a
somewhat simpler style of table.
format_table_simple(
DF,
shading_column,
merge_shaded_cells = TRUE,
merge_columns = NA,
sort_column,
bold_cells = list(c(0, NA)),
highlight_gmr_colors = NA,
highlight_so_cutoffs = NA,
highlight_so_colors = "yellow to red",
font = "Palatino Linotype",
fontsize = 11,
column_widths = NA,
include_header = TRUE,
alignment = "left",
save_table = NA,
page_orientation = "portrait",
title_document = NA,
table_caption = NA
)
DF |
a data.frame |
shading_column |
If you would like to alternate the shading of the rows
in the output table, supply here the unquoted name of the column to check
for when to change the shading; every time that column's value changes, the
shading will alternate between white and light gray. For example, if you
have a table with PK values for multiple files and you have more than one
row per file (an example of this would be the output from the function
|
merge_shaded_cells |
TRUE (default) or FALSE for whether to merge the
cells that have the same shade. This only applies when one of the columns
in the input data.frame is used for deciding when to alternate shading,
that is, |
merge_columns |
a vector of quoted column names or of numeric column
positions that should be merged vertically whenever the values are the
same. For example, |
bold_cells |
optionally specify cells in the table to be in bold-face
text with a numeric vector where the 1st number is the row number and the
2nd number is the column number (just like regular row and column
specifications in R). For example, |
highlight_gmr_colors |
optionally specify a set of colors to use for highlighting geometric mean ratios for DDIs. Options are "yellow to red", "green to red", "traffic" (a more vivid version of "green to red"), or a vector of 4 colors of your choosing. If left as NA, no highlighting for GMR level will be done. |
highlight_so_cutoffs |
optionally specify cutoffs for highlighting any
simulated-to-observed ratios. Anything that is above those values or below
the inverse of those values will be highlighted. To figure out what cells
to highlight, this looks for a column titled "Statistic" or "Stat", then
looks for what row contains "S/O" or "simulated (something something)
observed" (as in, we'll use some wildcards to try to match your specific
text). Next, it looks for any values in that same row that are above those
cutoffs. This overrides anything else you specified for highlighting. The
default is NA, for not highlighting based on S/O value. Acceptable
input for, say, highlighting values that are > 125% or < 80% of the
observed and also, with a second color, values that are > 150% or < 66%
would be: |
highlight_so_colors |
optionally specify a set of colors to use for
highlighting S/O values outside the limits you specified with
.
If you do specify your own bespoke colors, you'll need to make sure that
you supply one color for every value in |
font |
font to use. Default is "Palatino Linotype" 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., |
include_header |
TRUE (default) or FALSE for whether to include the header row |
alignment |
alignment of text throughout table. Options are "left" (default), "right", "center", or "justify". |
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" |
title_document |
optionally specify a title for the Word document output. If you don't save the table, this will be ignored. |
table_caption |
optionally add some text for a table caption. If the table you supply contains a column titled "File", there will already be a caption listing the source files; this would add some additional text before that. |
a formatted table
# None yet
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.