Skip to content
Snippets Groups Projects
Commit 98f642e9 authored by Carine Rey's avatar Carine Rey
Browse files

update session5

parent 49987e1f
No related branches found
No related tags found
1 merge request!6Switch to main as default branch
---
title: "R#5: Pipping and grouping"
author: "Laurent Modolo [laurent.modolo@ens-lyon.fr](mailto:laurent.modolo@ens-lyon.fr)"
date: "2021"
date: "2022"
output:
rmdformats::downcute:
self_contain: true
use_bookdown: true
default_style: "light"
lightbox: true
css: "http://perso.ens-lyon.fr/laurent.modolo/R/src/style.css"
css: "../www/style_Rmd.css"
---
```{r include=FALSE}
library(fontawesome)
```
 `r fa(name = "fas fa-house", fill = "grey", height = "1em")`  https://can.gitbiopages.ens-lyon.fr/R_basis/
```{r setup, include=FALSE}
rm(list=ls())
knitr::opts_chunk$set(echo = TRUE)
......@@ -78,8 +84,8 @@ Try to pipe operators to rewrite your precedent code with only **one** variable
<p>
```{r pipe_example_b, include=TRUE}
flights_md2 <- flights %>%
mutate(most_delay = min_rank(desc(dep_delay))) %>%
filter(most_delay < 10) %>%
mutate(most_delay = min_rank(desc(dep_delay))) %>%
filter(most_delay < 10) %>%
arrange(most_delay)
```
</p>
......@@ -164,8 +170,6 @@ summ_delay_filghts <- flights %>%
filter(dest != "HNL") %>%
filter(delay < 40 & delay > -20)
ggplot(data = summ_delay_filghts, mapping = aes(x = dist, y = delay, size = count)) +
geom_point() +
geom_smooth(method = lm, se = FALSE) +
......@@ -395,4 +399,4 @@ flights %>%
</p>
</details>
## See you in [R.6: tidydata](http://perso.ens-lyon.fr/laurent.modolo/R/session_6/)
## See you in [R.6: tidydata](https://can.gitbiopages.ens-lyon.fr/R_basis/session_6/)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment