g_lineplot
tableh_format_row(x, format, labels = NULL)
A single row data.frame
object.
(named list
)
list of numerical values to be formatted and optionally labeled.
Elements of x
must be numeric
vectors.
(named character
or NULL
)
format patterns for x
. Names of the format
must
match the names of x
. This parameter is passed directly to the rtables::format_rcell
function through the format
parameter.
(named character
or NULL
)
optional labels for x
. Names of the labels
must
match the names of x
. When a label is not specified for an element of x
,
then this function tries to use label
or names
(in this order) attribute of that element
(depending on which one exists and it is not NULL
or NA
or NaN
). If none of these attributes
are attached to a given element of x
, then the label is automatically generated.
mean_ci <- c(48, 51)
x <- list(mean = 50, mean_ci = mean_ci)
format <- c(mean = "xx.x", mean_ci = "(xx.xx, xx.xx)")
labels <- c(mean = "My Mean")
h_format_row(x, format, labels)
attr(mean_ci, "label") <- "Mean 95% CI"
x <- list(mean = 50, mean_ci = mean_ci)
h_format_row(x, format, labels)
Run the code above in your browser using DataLab