A geom that shows the linear model of a sample of observations

geom_lm_sample(
  mapping = NULL,
  data = NULL,
  position = "identity",
  na.rm = FALSE,
  show.legend = NA,
  inherit.aes = TRUE,
  ...
)

Arguments

mapping

aesthetic mappings

data

global data

position

ggplot2 positions

na.rm

logical remove na

show.legend

logical, should legend be displayed for layer

inherit.aes

logical, should global aes be used for this layer

...

all the geom_point arguments

Value

a geom layer

Examples

my_seed <- sample(1:100, 1) library(ggplot2) ggplot(data = cars) + aes(x = speed, y = dist) + geom_point() + geom_smooth(method = lm, se = FALSE) + geom_point_sample(color = "red", seed = my_seed) + geom_lm_sample(color = "red", seed = my_seed)
#> Default sample_size is 10
#> sample size is 10 by default
#> `geom_smooth()` using formula 'y ~ x'