This is a small introduction to distributions and how to fit them to ggplot2 charts.
In statistics a distribution is a function that shows the possible values for a variable and how often they occur. It is also a probability distribution.
We will use A&E Data Downloaded from NHS Digital website, and we will apply a Normal distribution to Type I Attendances metric.
-- Attaching core tidyverse packages ------------------------ tidyverse 2.0.0 --
v dplyr 1.1.2 v readr 2.1.4
v forcats 1.0.0 v stringr 1.5.0
v ggplot2 3.4.4 v tibble 3.2.1
v lubridate 1.9.2 v tidyr 1.3.0
v purrr 1.0.1
-- Conflicts ------------------------------------------ tidyverse_conflicts() --
x dplyr::filter() masks stats::filter()
x dplyr::lag() masks stats::lag()
i Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(janitor)
Attaching package: 'janitor'
The following objects are masked from 'package:stats':
chisq.test, fisher.test
library(readxl)library(here)
here() starts at C:/R/WorkingDir/Pablo-source.github.io