View source: R/functionsPlotting_circular.R
superbPlot.circularline | R Documentation |
superb comes with a few circular layouts for making plots. It produces ggplot objects that can be further customized.
superbPlot.circularline(
summarydata,
xfactor,
groupingfactor,
addfactors,
rawdata = NULL,
pointParams = list(),
lineParams = list(),
errorbarParams = list(),
facetParams = list(),
radarParams = 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 |
lineParams |
(optional) list of graphic directives that are sent to the |
errorbarParams |
(optional) list of graphic directives that are sent to the |
facetParams |
(optional) list of graphic directives that are sent to the |
radarParams |
(optional) list of arguments to the radar coordinates (seel |
xAsFactor |
(optional) Boolean to indicate if the factor on the horizontal should be continuous or discrete (default is discrete) |
A few things to note:
You can at any time undo the polar coordinates by using
+ coord_cartesian()
. It is sometimes easier when developping the plots.
Also, if ever you want to modify the scale post-hoc (e.g., to change
the labels of the group), you can, but your scale_x_continuous
must
absolutely contains the two arguments:
scale_x_continuous(
oob = scales::oob_keep,
limits = c(0, 0.00001+ NUMBER OF CONDITIONS ),
# any other argument such as labels = c("",...)
)
It has these parameters:
a ggplot object
# This will make a plot with lines
superb(
len ~ dose + supp,
ToothGrowth,
plotStyle="circularline"
)
# if you extract the data with superbData, you can
# run this layout directly
#processedData <- superb(
# len ~ dose + supp,
# ToothGrowth,
# showPlot = FALSE
#)
#
#superbPlot.circularline(processedData$summaryStatistic,
# "dose",
# "supp",
# ".~.",
# processedData$rawData)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.