Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R_basis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CAN
R_basis
Commits
98f642e9
Commit
98f642e9
authored
2 years ago
by
Carine Rey
Browse files
Options
Downloads
Patches
Plain Diff
update session5
parent
49987e1f
No related branches found
No related tags found
No related merge requests found
Pipeline
#368
failed
2 years ago
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
session_5/session_5.Rmd
+11
-7
11 additions, 7 deletions
session_5/session_5.Rmd
with
11 additions
and
7 deletions
session_5/session_5.Rmd
+
11
−
7
View file @
98f642e9
---
---
title: "R#5: Pipping and grouping"
title: "R#5: Pipping and grouping"
author: "Laurent Modolo [laurent.modolo@ens-lyon.fr](mailto:laurent.modolo@ens-lyon.fr)"
author: "Laurent Modolo [laurent.modolo@ens-lyon.fr](mailto:laurent.modolo@ens-lyon.fr)"
date: "202
1
"
date: "202
2
"
output:
output:
rmdformats::downcute:
rmdformats::downcute:
self_contain: true
self_contain: true
use_bookdown: true
use_bookdown: true
default_style: "light"
default_style: "light"
lightbox: true
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}
```{r setup, include=FALSE}
rm(list=ls())
rm(list=ls())
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_chunk$set(echo = TRUE)
...
@@ -78,8 +84,8 @@ Try to pipe operators to rewrite your precedent code with only **one** variable
...
@@ -78,8 +84,8 @@ Try to pipe operators to rewrite your precedent code with only **one** variable
<p>
<p>
```{r pipe_example_b, include=TRUE}
```{r pipe_example_b, include=TRUE}
flights_md2 <- flights %>%
flights_md2 <- flights %>%
mutate(most_delay = min_rank(desc(dep_delay))) %>%
mutate(most_delay = min_rank(desc(dep_delay))) %>%
filter(most_delay < 10) %>%
filter(most_delay < 10) %>%
arrange(most_delay)
arrange(most_delay)
```
```
</p>
</p>
...
@@ -164,8 +170,6 @@ summ_delay_filghts <- flights %>%
...
@@ -164,8 +170,6 @@ summ_delay_filghts <- flights %>%
filter(dest != "HNL") %>%
filter(dest != "HNL") %>%
filter(delay < 40 & delay > -20)
filter(delay < 40 & delay > -20)
ggplot(data = summ_delay_filghts, mapping = aes(x = dist, y = delay, size = count)) +
ggplot(data = summ_delay_filghts, mapping = aes(x = dist, y = delay, size = count)) +
geom_point() +
geom_point() +
geom_smooth(method = lm, se = FALSE) +
geom_smooth(method = lm, se = FALSE) +
...
@@ -395,4 +399,4 @@ flights %>%
...
@@ -395,4 +399,4 @@ flights %>%
</p>
</p>
</details>
</details>
## See you in [R.6: tidydata](http://
perso.ens-lyon.fr/laurent.modolo/R
/session_6/)
## See you in [R.6: tidydata](http
s
://
can.gitbiopages.ens-lyon.fr/R_basis
/session_6/)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment