NHANES: Gender

library(NHANES)
NHANES %>% ggplot(aes(x=Gender)) + geom_bar()

NHANES %>%
  dplyr::count(Gender) %>%
  mutate(probability = n/sum(n))
## # A tibble: 2 × 3
##   Gender     n probability
##   <fct>  <int>       <dbl>
## 1 female  5020       0.502
## 2 male    4980       0.498