library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──
## ✓ ggplot2 3.3.5 ✓ purrr 0.3.4
## ✓ tibble 3.1.6 ✓ dplyr 1.0.8
## ✓ 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()
Pi = .3
Complement = 1-Pi
PiTimesComplement = Pi*(Complement)
SqrtPiTimesComplement = sqrt(PiTimesComplement)
library(ggstamp)
ggcanvas() +
stamp_segment(yend = 0) +
stamp_point(size = 2, x = 1) +
stamp_point(size = 2) +
stamp_spoke(x0 = Pi, y0 = 0,
angle = pi,
radius = Pi,
color = "cadetblue"
) +
stamp_spoke(x0 = Pi, y0 = 0, angle = 0,
radius = 1 - Pi,
color = "goldenrod3") +
stamp_point(x = Pi, y = 0, size = 3)
ggcanvas() +
stamp_segment(yend = 0) +
stamp_point(size = 2, x = 1) +
stamp_point(size = 2) +
stamp_spoke(x0 = Pi, y0 = 0,
angle = pi,
radius = Pi,
color = "cadetblue"
) +
stamp_spoke(x0 = Pi, y0 = 0, angle = 0:20/40 * pi,
radius = 1 - Pi, alpha = 1/21:1,
color = "goldenrod3") +
stamp_point(x = Pi, y = 0, size = 3)
ggcanvas() +
stamp_segment(yend = 0) +
stamp_point(size = 2, x = 1) +
stamp_point(size = 2) +
stamp_spoke(x0 = Pi, y0 = 0,
angle = pi,
radius = Pi,
color = "cadetblue"
) +
stamp_spoke(x0 = Pi, y0 = 0, angle = 0:20/40 * pi,
radius = 1 - Pi, alpha = 1/21:1,
color = "goldenrod3") +
stamp_point(x = Pi, y = 0, size = 3) +
stamp_rect(xmin = 0, ymin = 0,
xmax = Pi, ymax = 1-Pi,
color = "cadetblue",
fill = "cadetblue",
alpha = .3)
## Warning: Ignoring unknown aesthetics: x, y
ggcanvas() +
stamp_segment(yend = 0) +
stamp_point(size = 2, x = 1) +
stamp_point(size = 2) +
stamp_spoke(x0 = Pi, y0 = 0,
angle = pi,
radius = Pi,
color = "cadetblue") +
stamp_spoke(x0 = Pi, y0 = 0, angle = 0:20/40 * pi,
radius = 1 - Pi, alpha = 1/21:1,
color = "goldenrod3") +
stamp_point(x = Pi, y = 0, size = 3) +
stamp_rect(xmin = Pi - sqrt(Pi * (1-Pi)), ymin = 0,
xmax = Pi, ymax = sqrt(Pi * (1-Pi)),
color = "cadetblue",
fill = "cadetblue",
alpha = .3)
## Warning: Ignoring unknown aesthetics: x, y
ggcanvas() +
stamp_segment(yend = 0) +
stamp_point(size = 2, x = 1) +
stamp_point(size = 2) +
stamp_spoke(x0 = Pi, y0 = 0,
angle = pi,
radius = Pi,
color = "cadetblue"
) +
stamp_spoke(x0 = Pi, y0 = 0, angle = 0:20/40 * pi,
radius = 1 - Pi, alpha = 1/21:1,
color = "goldenrod3") +
stamp_point(x = Pi, y = 0, size = 3) +
stamp_rect(xmin = Pi - sqrt(Pi * (1-Pi)), ymin = 0,
xmax = Pi, ymax = sqrt(Pi * (1-Pi)),
color = "cadetblue",
fill = "cadetblue",
alpha = .3) +
ggxmean::stamp_normal_dist(mean = Pi, sd = SqrtPiTimesComplement)
## Warning: Ignoring unknown aesthetics: x, y