| gf_sd_ruler | R Documentation |
gf_sd_ruler(
p,
y = NULL,
data = NULL,
x = NULL,
where = c("middle", "mean", "median"),
color = "red",
size = 0.8,
...
)
p |
A ggplot object (typically from |
y |
The y-variable (bare name or string). Defaults to the plot's mapped y aesthetic if omitted. |
data |
Dataset. Defaults to |
x |
The x-variable for placement. Defaults to the plot's mapped x. |
where |
Where on the x-axis to place the ruler: |
color |
Segment color. Default |
size |
Segment |
... |
Additional arguments passed to |
Adds a vertical segment showing one standard deviation of a variable, placed at a specified x position. Works for both numeric x (scatter) and categorical x (jitter) plots.
A ggplot object with the SD ruler segment added.
gf_jitter(Thumb ~ Height, data = Fingers) %>%
gf_model(lm(Thumb ~ NULL, data = Fingers)) %>%
gf_sd_ruler()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.