f_geom_line_endpoint: A geom that draws a point at the intercept of linear model...

Description Usage Arguments Examples

View source: R/f_geom_line_endpoint.R

Description

A geom that draws a point at the intercept of linear model estimate

Usage

1
2
3
4
5
6
7
8
9
f_geom_line_endpoint(
  mapping = NULL,
  data = NULL,
  position = "identity",
  na.rm = FALSE,
  show.legend = NA,
  inherit.aes = TRUE,
  ...
)

Arguments

...

all the geom_point arguments

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# without the function
library(magrittr)
library(dplyr)
cars %>%
  mutate(speed_cat = speed > 8) %>%
  group_by(speed_cat) %>%
  filter(speed == max(speed)) ->
 cars_group_endpoint

library(ggplot2)
ggplot(data = cars) +
 aes(x = speed, y = dist) +
 aes(color = speed > 8) +
 geom_line() +
 geom_point(data = cars_group_endpoint)
layer_data(last_plot(), 2)

# the proto
"StatEndpoint"
f_geom_line_endpoint

# the function
f_geom_line_endpoint

# using the function
ggplot(data = cars) +
 aes(x = speed, y = dist) +
 geom_line() +
 f_geom_line_endpoint(size = 4) +
 aes(color = speed > 9)
 layer_data(last_plot(), 2)

EvaMaeRey/ggextend documentation built on Dec. 17, 2021, 7:24 p.m.