geom_float | R Documentation |
geom_float
draws a horizontal line placed at the corresponding value. It can be used to compare one continuous and one categorical variable.
geom_floatbar
fills in the differences between multiple variables.
geom_float(mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE)
geom_floatbar(mapping = NULL,
data = NULL,
stat = "diff",
position = "identity",
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE)
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. |
stat |
Use to override the default connection between |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
... |
Other arguments passed on to |
na.rm |
If FALSE, the default, missing values are removed with a warning. If TRUE, missing values are silently removed. |
show.legend |
logical. Should this layer be included in the legends? NA, the default, includes if any aesthetics are mapped. FALSE never includes, and TRUE always includes. It can also be a named logical vector to finely select the aesthetics to display. |
inherit.aes |
If FALSE, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions that define both data and aesthetics and shouldn't inherit behaviour from the default plot specification, e.g. |
geom_float()
and geom_floatbar()
understand the following aesthetics (required aesthetics are in bold):
x
y
alpha
colour
fill
group
linetype
stroke
Learn more about setting these aesthetics in vignette("ggplot2-specs")
.
Ko ABE
ggplot(sleep, aes(x=ID, y=extra, colour=group))+
geom_float()
ggplot(sleep, aes(x=ID, y=extra, colour=group))+
geom_floatbar()+
geom_float()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.