Description Usage Arguments Examples
View source: R/q_geom_point_sample.R
A geom that shows a sampling of points
1 2 3 4 5 6 7 8 9 |
... |
all the geom_point arguments |
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.