library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──
## ✓ ggplot2 3.3.5 ✓ purrr 0.3.4
## ✓ tibble 3.1.2 ✓ dplyr 1.0.7
## ✓ tidyr 1.0.2 ✓ stringr 1.4.0
## ✓ readr 1.3.1 ✓ forcats 0.5.0
## Warning: package 'ggplot2' was built under R version 3.6.2
## Warning: package 'tibble' was built under R version 3.6.2
## Warning: package 'purrr' was built under R version 3.6.2
## Warning: package 'dplyr' was built under R version 3.6.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
datasauRus::datasaurus_dozen %>%
ggplot() +
aes(x = x,
y = y) +
geom_point() +
facet_wrap(facets = vars(dataset)) +
# mean of x
ggxmean::geom_x_mean() +
ggxmean::geom_y_mean() +
# mean of y
ggxmean:::geom_x1sd(linetype = "dashed") +
ggxmean:::geom_y1sd(linetype = "dashed") +
# linear model
ggxmean::geom_lm() +
ggxmean::geom_lm_formula() +
# Pearson correlation
ggxmean:::geom_corrlabel()