'ggplot2: stat_summary -where does the "min" in "fun.min" come from?
Apologies beforehand, I am new to coding and am learning R from here: https://r4ds.had.co.nz/data-visualisation.html#statistical-transformations
Using tidyverse package with ggplot2
There is a section at the end where we are plotting the "diamonds" dataset using "stat_summary":
ggplot(data = diamonds) +
stat_summary(
mapping = aes(x = cut, y = depth),
fun.min = min,
fun.max = max,
fun = median
)
Where/how do "min", "max", "median" from the above code get defined? I understand that these summary functions (fun.min, fun.max, and fun) take numeric vectors and output a single number summary, but I cannot find any documentation saying where these "min", "max", and "median" vectors get defined nor can I find the answers in the solutions manual (https://jrnold.github.io/r4ds-exercise-solutions/data-visualisation.html#statistical-transformations)
Thank you!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
