knitr::opts_chunk$set(
  collapse = TRUE,
  message = FALSE,
  fig.width = 5,
  fig.retina = 2,
  comment = "#>"
)
library(mysimplecompendium)
library(tidyverse)
library(here)

starwars %>% 
  mutate(gender_fct = fct_infreq(gender)) %>% 
  ggplot(aes(gender_fct)) +
  geom_bar() +
  xlab("") +
  theme_minimal(base_size = 14)

In Figure \@ref(fig:starwars-gender-plot) we can see that there is an imbalance in the gender ratios of Starwars characters. This needs to be fixed.

Other files in /vignettes

We can put anything in /vingettes, such as data files:

my_data <- read_csv(here("vignettes/my-data.csv"))

And R script files:

source(here("vignettes/my-script.R"))
plus_two(my_data$a)


sanjanagupta16/DATA-598-WI20-week-5 documentation built on March 12, 2020, 7:20 a.m.