View source: R/utilities-mapping.R
getDefaultCaptions | R Documentation |
Creates default legend captions by concatenating the values of
the data
and metaData
of variableList
variables from data
.
getDefaultCaptions(
data,
metaData = NULL,
variableList = colnames(data),
sep = "-"
)
data |
data.frame used for legend caption |
metaData |
list of lists containing metaData on |
variableList |
ordered vector of variables used for specifying the caption |
sep |
characters separating variables in caption |
Factor levels corresponding to the legend captions
data <- data.frame(
Population = c("Caucasian", "Asian", "Caucasian", "Asian"),
Gender = c("Male", "Male", "Female", "Female"),
Dose = c(50, 100, 100, 50),
Compound = c("Midazolam", "Midazolam", "Midazolam", "Midazolam")
)
metaData <- list(Dose = list(unit = "mg"))
# Get captions using every variable of data
getDefaultCaptions(data, metaData)
# Get captions using specific variables of data
getDefaultCaptions(data, metaData, variableList = c("Gender", "Population"))
# Get captions separating variables witha space (character " ")
getDefaultCaptions(data, metaData, sep = " ")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.