This is a basic example which shows you how easy it is to generate
data with {TidyDensity}
:
library(TidyDensity)
library(dplyr)
library(ggplot2)
tidy_normal()
#> # A tibble: 50 × 7
#> sim_number x y dx dy p q
#> <fct> <int> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 1 -1.08 -3.86 0.000222 0.139 -1.08
#> 2 1 2 1.30 -3.72 0.000622 0.904 1.30
#> 3 1 3 1.07 -3.57 0.00152 0.857 1.07
#> 4 1 4 0.0829 -3.42 0.00327 0.533 0.0829
#> 5 1 5 0.650 -3.27 0.00612 0.742 0.650
#> 6 1 6 1.05 -3.12 0.0100 0.854 1.05
#> 7 1 7 -0.314 -2.97 0.0144 0.377 -0.314
#> 8 1 8 -0.641 -2.83 0.0180 0.261 -0.641
#> 9 1 9 1.50 -2.68 0.0199 0.933 1.50
#> 10 1 10 0.581 -2.53 0.0194 0.719 0.581
#> # ℹ 40 more rows
An example plot of the tidy_normal
data.
We can also take a look at the plots when the number of simulations is greater than nine. This will automatically turn off the legend as it will become too noisy.