This function creates a new variable called "Fatal accidents rate", given by the number of fatal accidents in 2000-2014 over the number of incidents in 2000-2014. It also creates a new variable called "safety", which returns TRUE if the fatal accidents rate of the airline is smaller than 0.2, otherwise it returns FALSE. Then it adds the new variables to the dataset and returns the new dataset. Note: this function requires the package tidyverse.
1 | prepare()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.