q_geom_point_sample: A geom that shows a sampling of points

Description Usage Arguments Examples

View source: R/q_geom_point_sample.R

Description

A geom that shows a sampling of points

Usage

1
2
3
4
5
6
7
8
9
q_geom_point_sample(
  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
# without the function
library(magrittr)
library(dplyr)
set.seed(1214)
cars %>%
 slice_sample( n = 10) ->
 cars_sample


library(ggplot2)
ggplot(data = cars) +
 aes(x = speed, y = dist) +
 geom_point() +
 geom_point(data = cars_sample,
            color = "magenta")

# the proto and function
"StatSamplepoint"
q_geom_point_sample

# using the function
ggplot(data = cars) +
 aes(x = speed, y = dist) +
 geom_point() +
 q_geom_point_sample(color = "red") +
 q_geom_point_sample(color = "green", sample_size = 5) +
 q_geom_point_sample(sample_size = 2, color = "blue")

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