R Error When Using Custom Function In Ggplot2 Stat Summary Stack Overflow

R Error When Using Custom Function In Ggplot2 Stat Summary Stack Overflow