It’s often useful to add new columns that are functions of existing columns. That’s the job of `mutate()`.
It’s often useful to add new columns that are functions of existing columns. That’s the job of `mutate()`.
<div class="pencadre">
<div class="pencadre">
First let's create a smaller dataset to work on `flights_sml` that contains
First lets create a smaller dataset to work on `flights_sml` that contains
- columns from `year` to `day`
- columns from `year` to `day`
- columns that ends with `delays`
- columns that ends with `delays`
- the `distance` and `air_time` columns
- the `distance` and `air_time` columns
...
@@ -620,11 +620,45 @@ top10 <- tab.sig %>%
...
@@ -620,11 +620,45 @@ top10 <- tab.sig %>%
</details>
</details>
The data is ready to be used to make a volcano plot!
The data is ready to be used to make a volcano plot!
<div class="pencadre">
To make the graph below, use `ggplot2`, the functions `geom_point()`, `geom_hline()`, `geom_vline()`, `theme_minimal()`, `theme()` (to remove the legend), `geom_label_repel()` and the function `scale_color_manual()` for the colors.
To make the graph below, use `ggplot2`, the functions `geom_point()`, `geom_hline()`, `geom_vline()`, `theme_minimal()`, `theme()` (to remove the legend), `geom_label_repel()` and the function `scale_color_manual()` for the colors.
</div>
**Tips 1 :** Don t forget the transformation of the adjusted pvalue.
**Tips 2 :** Feel free to search your favorite Web browser for help.
```{r VolcanoPlotDemo, }
```{r VolcanoPlotDemo, echo = FALSE}
ggplot(tab.sig, aes(x = log2FoldChange, y = -log10(padj), col = UpDown)) +