Data wrangling with dplyr - NHS-R Community

[Pages:59]Credit: JustTooLazy. Licensed under CC BY 2.0.

data wrangling with dplyr

Andrew Jones | Strategy Unit

1

Wrangling

Reshaping or transforming "raw" data into a format which is easier to work with. (For later visualisation, computing of statistics, and modelling.)

2

The dplyr package

Dplyr is a language for data manipulation.

Most wrangling puzzles can be solved with knowledge of just 5 dplyr verbs (5 functions).

These will be the subject of this session.

3

Gapminder

4

Gapminder

Data from install.packages("gapminder")

library(gapminder)

5

Q. How many variables here? Meaningful names? What type?

(more on this tomorrow)

6

dplyr

5 arrange filter mutate verbs summarise group_by

Will help us gain a deeper understanding of our data sets.

7

Newspaper puzzles

Level 2

18 ?3 x7 -6 ?3

8

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download