View source: R/makeBarPolarPlot.R
makeBarPolarPlot | R Documentation |
Create a bar/polar plot. The input arguments for this functions are
typically generated using bettrGetReady
, which ensures that
all required columns are available.
makeBarPolarPlot(
bettrList = NULL,
plotdata,
scoredata,
idCol,
metricCol = "Metric",
valueCol = "ScaledValue",
weightCol = "Weight",
scoreCol = "Score",
metricGroupCol = "metricGroup",
metricColors,
metricCollapseGroup = FALSE,
metricGrouping = "---",
methods = NULL,
labelSize = 10,
showComposition = FALSE,
scaleFactorPolars = 1
)
bettrList |
A |
plotdata |
A |
scoredata |
A |
idCol |
Character scalar indicating which column of |
metricCol |
Character scalar indicating which column of |
valueCol |
Character scalar indicating which column of |
weightCol |
Character scalar indicating which column of |
scoreCol |
Character scalar indicating which column of |
metricGroupCol |
Character scalar indicating which column of
|
metricColors |
Named list with colors used for the metrics and
any other metric annotations. Typically obtained as
|
metricCollapseGroup |
Logical scalar indicating whether metrics
should be collapsed by the group variable provided by
|
metricGrouping |
Character scalar indicating the column of
|
methods |
Character vector containing the methods for which to make
polar plots. If |
labelSize |
Numeric scalar providing the size of the labels in the plot. |
showComposition |
Logical scalar indicating whether to show the composition of the score in the bar plots. This is only interpretable if the scores are obtained via a weighted mean approach. |
scaleFactorPolars |
Numeric scalar giving the scale factor determining the size of the polar plots. |
A ggplot
object.
Charlotte Soneson
## Generate example data
df <- data.frame(Method = c("M1", "M2", "M3"),
metric1 = c(1, 2, 3),
metric2 = c(3, 1, 2))
metricInfo <- data.frame(Metric = c("metric1", "metric2", "metric3"),
Group = c("G1", "G2", "G2"))
idInfo <- data.frame(Method = c("M1", "M2", "M3"),
Type = c("T1", "T1", "T2"))
prepData <- bettrGetReady(df = df, idCol = "Method",
metricInfo = metricInfo, idInfo = idInfo)
makeBarPolarPlot(bettrList = prepData, showComposition = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.