geom_mk | R Documentation |
geom_mk
geom_mk(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
fun_slope = slope_mk,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
stat_mk(
mapping = NULL,
data = NULL,
geom = "abline",
position = "identity",
fun_slope = slope_mk,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE,
...
)
stat_spike(
mapping = NULL,
data = NULL,
geom = "point",
position = "identity",
halfwin = 3,
sd.times = 3,
trs = NA,
verbose = FALSE,
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. There are three options: If A A |
position |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
... |
Other arguments passed on to
|
fun_slope |
function to calculate slope, default |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
geom , stat |
Use to override the default connection between
|
No return. This function is used to calculate data for gglot2 geom_*
,
just like ggplot2::stat_smooth()
.
No return. This function is used to calculate data for gglot2 geom_*
,
just like ggplot2::stat_smooth()
.
library(ggplot2)
library(rtrend)
ggplot(mpg, aes(displ, hwy, colour = drv)) +
geom_point() +
stat_mk(linewidth = 1, fun_slope = slope_mk) +
geom_smooth(method = "lm", se = FALSE, linetype = 2)
ggplot(mpg, aes(displ, hwy, colour = drv)) +
geom_point() +
geom_mk(linewidth = 1, fun_slope = slope_mk) +
geom_smooth(method = "lm", se = FALSE, linetype = 2)
library(ggplot2)
library(rtrend)
ggplot(mpg, aes(displ, hwy, colour = drv)) +
geom_point() +
stat_mk(linewidth = 1, fun_slope = slope_mk) +
geom_smooth(method = "lm", se = FALSE, linetype = 2)
ggplot(mpg, aes(displ, hwy, colour = drv)) +
geom_point() +
geom_mk(linewidth = 1, fun_slope = slope_mk) +
geom_smooth(method = "lm", se = FALSE, linetype = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.