View source: R/functionsPlotting_advanced.R
superbPlot.halfwidthline | R Documentation |
superbPlot comes with a few built-in templates for making the final plots. All produces ggplot objects that can be further customized. The half-width confidence interval line plot is EXPERIMENTAL. It divides the CI length by two, one thick section and one thin section. The functions, to be "superbPlot-compatible", must have these parameters:
superbPlot.halfwidthline(
summarydata,
xfactor,
groupingfactor,
addfactors,
rawdata = NULL,
pointParams = list(),
lineParams = list(),
errorbarParams = list(),
errorbarlightParams = list(),
facetParams = list(),
xAsFactor = TRUE
)
summarydata |
a data.frame with columns "center", "lowerwidth" and "upperwidth" for each level of the factors; |
xfactor |
a string with the name of the column where the factor going on the horizontal axis is given; |
groupingfactor |
a string with the name of the column for which the data will be grouped on the plot; |
addfactors |
a string with up to two additional factors to make the rows and columns panels, in the form "fact1 ~ fact2"; |
rawdata |
always contains "DV" for each participants and each level of the factors |
pointParams |
(optional) list of graphic directives that are sent to the geom_bar layer |
lineParams |
(optional) list of graphic directives that are sent to the geom_bar layer |
errorbarParams |
(optional) list of graphic directives that are sent to the geom_superberrorbar layer |
errorbarlightParams |
(optional) graphic directives for the second half of the error bar; |
facetParams |
(optional) list of graphic directives that are sent to the facet_grid layer |
xAsFactor |
(optional) Boolean to indicate if the factor on the horizontal should continuous or discrete (default is discrete) |
a ggplot object
# This will make a plot with lines
superb(
len ~ dose + supp,
ToothGrowth,
plotStyle="halfwidthline"
)
# if you extract the data with superbData, you can
# run this layout directly
#processedData <- superb(
# len ~ dose + supp,
# ToothGrowth,
# showPlot = FALSE
#)
#
#superbPlot.halfwidthline(processedData$summaryStatistic,
# "dose",
# "supp",
# ".~.",
# processedData$rawData)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.