addggLayers
addggLayers.RdAdd Spike Histograms and Extended Box Plots to ggplot
Arguments
- g
a
ggplotobject- data
data frame/table containing raw data
- type
specifies either extended box plot or spike histogram. Both are horizontal so are showing the distribution of the x-axis variable.
- ylim
y-axis limits to use for scaling the height of the added plots, if you don't want to use the limits that
ggplothas stored- by
the name of a variable in
dataused to stratify raw data- value
name of x-variable
- frac
fraction of y-axis range to devote to vertical aspect of the added plot
- mult
fudge factor for scaling y aspect
- facet
optional faceting variable
- pos
position for added plot
- showN
sete to
FALSEto not show sample sizes
Details
For an example see this. Note that it was not possible to just create the layers needed to be added, as creating these particular layers in isolation resulted in a ggplot error.