a two hour tour of the tidyverse - london r · •the tidyverse is designed to work with tidy data...

79
Aimee Gott Senior Consultant [email protected] A Two Hour Tour of the Tidyverse Aimee Gott Senior Consultant [email protected]

Upload: others

Post on 20-May-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

A Two Hour Tour

of the Tidyverse

Aimee GottSenior [email protected]

Page 2: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

In This Workshop

• You will learn…

• What the tidyverse is & why bother using it

• What tools are available in the tidyverse

• A brief overview of core functionality

Page 3: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Data for Today

• Funding of Olympic sports

• UK Sport World Class Performance Programme

• Data from Sydney (2000) to Rio de Janeiro (2016)

• Extracted from

http://www.uksport.gov.uk/our-work/investing-in-

sport/historical-funding-figures

Page 4: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Where to Get the Data

Files in multiple formats available on GitHub:

https://github.com/MangoTheCat/Olympic-Funding-

Data

Page 5: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

WHAT IS THE TIDYVERSE?

Page 6: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Unified Packages

• Set of unified packages covering the data

analysis workflow

• Implementing a single philosophy

• Makes it easy to learn and use!

Page 7: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Import Tidy

Model

CommunicateTransform

Visualise

Program

Page 8: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Useful Resouces

RStudio Cheat Sheets

https://www.rstudio.com/resources/cheatsheets/

(My advice – print them all and keep them on your desk!)

Page 9: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Further Reading

R for Data Science (2017), Hadley Wickham &

Garrett Grolemund, O'Reilly

Available online:

http://r4ds.had.co.nz/

Page 10: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

WHAT'S IN THE TIDYVERSE?

Page 11: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

What are the Packages?

• 18 Core Packages

• Loads more dependencies

• 6 Packages loaded with Tidyverse

• All others installed and available

Page 12: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Packages Loaded By Default

• ggplot2

• dplyr

• tidyr

• readr

• purrr

• tibble

Page 13: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Other Installed Packages

• hms

• stringr

• lubridate

• forcats

• haven

• httr

• jsonlite

• readxl

• rvest

• xml2

• modelr

• broom

Page 14: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

A DIVE INTO THE PACKAGES

Page 15: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Import Tidy

Model

CommunicateTransform

Visualise

Program

Page 16: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Import

• readr

• haven

• httr

• jsonlite

• readxl

• rvest

• xml2

Page 17: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Reading Web Data: rvest

read_html("www.myWebPage.co.uk")

• Includes lots of functions for extracting specific

elements of a web page

Page 18: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Read Olympic Data

funding <-

read_html("http://www.uksport.gov.uk/our

-work/investing-in-sport/

historical-funding-figures")

funding <- html_table(funding, header = TRUE)

Page 19: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Reading Tabular Data: readr

read_csv("myFile.csv", na = c(" ", "NA"))

Other variants include:

• read_tsv

• read_fwf

• read_delim

Page 20: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Reading Summer Olympics Data

summer <-

read_csv("SummerOlympicsFunding.csv",

na = c("n/a", "n/a**"),

col_types = cols(

.default = col_number(),

Sport = col_character())

)

Page 21: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Reading MS Excel Data: readxl

read_excel("myExcelFile.xlsx",

sheet = "Sheet 1")

Page 22: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Reading Proprietary Data: haven

read_sas("mySASData.sas7bdat")

Other formats include:

• SPSS Data

• Stata Data

Page 23: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Import Tidy

Model

CommunicateTransform

Visualise

Program

Page 24: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Tidy

• tibble

• tidyr

Page 25: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

What is tibble?

• A tibble is an update to the data frame

• Generally works as a data frame but with extra

features

• Doesn’t change column names

• Doesn't convert strings to factors

• Doesn't allow partial matching of names

• Doesn't create row names

Page 26: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

How Do You Create a tibble?

• Using the import functions in the tidyverse

• With the tibble or tribble functions

Page 27: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

What Does the tibble Package Do?

• Provides utility functions for working with tibble

structure

• Generally don't need to directly use the package

much

Page 28: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Functions in tibble

• glimpse – useful overview of data

• tibble/tribble – creation of tibbles

• add_row/add_column – helpful functions for

adding elements to an existing tibble

• There are also a number of functions for

converting rownames if needed

Page 29: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Creating A Reference Tibble

years <- tribble(

~Location, ~Year, ~Month, ~Day,

"Sydney", 2000, 9, 15,

"Athens", 2004, 8, 13,

"Beijing", 2008, 8, 8,

"London", 2012, 7, 27,

"Rio de Janeiro", 2016, 8, 5

)

Page 30: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Tidy Data

• The tidyverse is designed to work with tidy data

• A single structure that is common to all of the

packages

• Makes it easy to move from manipulation to

visualisation to modelling without changing the data

Page 31: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

What is Tidy Data?

• Each variable has its own column

• Each observation has its own row

• Each value has its own cell

Page 32: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Tidying the Olympic Data

summer <- gather(summer,

Location,

Funding,

-Sport)

Page 33: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Working with Missing Values

summer <- replace_na(summer,

replace = list(Funding = 0))

Page 34: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Import Tidy

Model

CommunicateTransform

Visualise

Program

Page 35: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Transform

• dplyr

• forcats

• stringr

• hms

• lubridate

Page 36: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Data Manipulation: dplyr

• Standard manipulations

• Filter

• Select

• Arrange

• Mutate

• Summarise

• Perform actions by group (group_by)

Page 37: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Join Related Data Sets

• Merge/Join two data sets

• Full

• Left/Right

• Inner

• Anti

• Semi

Page 38: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Joining Olympic Data

summer <- full_join(summer, years) %>%

filter(Sport != "Total")

Page 39: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Manipulating Factors: forcats

• Factors are a representation of categorical data

• Forcats allows us to easily manipulate factors

• Change names

• Group levels

• Reorder levels

Page 40: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Without Manipulation

Page 41: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

With Manipulation

Page 42: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Reordering Olympic Years

numberNoFund <- summer %>%

filter(Funding == 0)

count(Location) %>%

left_join(years) %>%

mutate(Location =

fct_reorder(Location, Year))

Page 43: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Manipulating Characters: stringr

• The stringr package provides consistent functions

for manipulating character strings

• Manipulations include:

• Concatenation

• Pattern search and replace

• Subset with strings

Page 44: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Combining Location and Year

str_c(

magrittr::use_series(years, Location),

"\n(",

magrittr::use_series(years, Year),

")"

)

Page 45: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Page 46: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Exercise

• Import the winter Olympics data csv

• By performing the appropriate manipulations (using tidyr, dplyr and forcats) • Which sport has the most funding by Sochi?

• Extract the data for just this sport

• What is the difference between the maximum and minimum funding levels for this sport?

• Can you create a simple graphic of this data?

• Why is there some missing data for this sport?

Page 47: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Manipulating Dates: lubridate

• Easy to use functions to convert characters to date

format

• ymd

• mdy

• dmy

• Manipulation functions to extract elements of dates

• Functions for accounting for addition of time periods

to dates e.g. accounting for 30/31 day months

Page 48: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Creating Olympic Start Dates

summer <- mutate(summer,

Date = str_c(Year, Month, Day, sep = "-"),

Date = ymd(Date)

)

Page 49: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Page 50: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Manipulating Times: HMS

• Allows working with just times

• Convert to just a time

• hms

Page 51: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Import Tidy

Model

CommunicateTransform

Visualise

Program

Page 52: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Visualise

• ggplot2

Page 53: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Creating Graphics: ggplot2

• A whole workshop on its own!

• Create quick plots with qplot

• Specify the type of plot using the geoms

• Add titles and labels with labs

Page 54: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Page 55: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Graphic of Olympic Funding

qplot(data = fundingTime,

x = Date, y = Funding/1e6,

colour = Sport,

geom = c("line", "point")) +

labs(title = "Increasing Funding ",

x = "", y = "Funding (Millions)",

colour = "Sport",

caption = "Data taken from ...")

Page 56: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Exercise

• Using the winter Olympics data create a graphic

showing the change in funding over time for all of

the winter Olympic sports

Page 57: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Import Tidy

Model

CommunicateTransform

Visualise

Program

Page 58: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Model

• modelr

• broom

Page 59: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Fitting Models: modelr

• Functionality for bootstrapping/cross validation

• Model metrics – rsquare, rmse

• Extracting predictions and residuals

Page 60: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Predicting Olympic Funding

fundingModel <- lm(Funding ~ Sport*Year,

data = fundingTime)

modelGrid <- data_grid(fundingTime,

Year, Sport)

modelGrid <- modelGrid %>%

add_predictions(fundingModel)

Page 61: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Page 62: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Investigating Model Residuals

fundingResid <- fundingTime %>%

add_residuals(fundingModel)

Page 63: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Page 64: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Assessing Model Quality: broom

• Provides functions for extracting details on the

model fit

• Model coefficients – tidy

• Model diagnostics – glance

• Useful for working with multiple models to

compare fit

Page 65: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Fit of Olympics Models

tidy(fundingModel)

glance(fundingModel)

Page 66: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Import Tidy

Model

CommunicateTransform

Visualise

Program

Page 67: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Program

• purrr

Page 68: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Iterating: purrr

• Iterate (over a vector of values) or apply to

multiple set/subsets of data

• Output can be one of many types based on the

function used:

• map

• map_df

• map_dbl

• …

Page 69: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Model For Each Sport

sportData <- fundingTime %>%

group_by(Sport) %>%

nest()

sportsModels <- map(sportData$data,

~lm(Funding ~ Year, data = .))

sportResid <- map2_df(sportData$data,

sportsModels,

add_residuals, .id = "Sport")

Page 70: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Page 71: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Import Tidy

Model

CommunicateTransform

Visualise

Program

Page 72: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Communicate

• There are no tidyverse packages directly aimed at

communicating results (other than creating

graphics)

• There are lots of packages that can be used to

present results

Page 73: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Options for Communicating Results

• Rmarkdown

• Shiny

• Flexdashboard

• bookdown/blogdown

Page 74: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

SUMMARY

Page 75: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Using the Tidyverse

• Single unified approach to manipulating and

analysing data

• Provides packages for all stages of the analysis

lifecycle

Page 76: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Learning More

• R for Data Science

• RStudio Cheat sheets

• Training

Page 77: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Upcoming Mango Training Courses

• An Introduction to R for Analytics

• Data Manipulation

• Data Visualisation

Page 78: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

EARL London Workshops

• Spark and R with sparklyr

• Web Scraping and Text Analysis in R

• Writing R Functions for Fun and Profit

• Working with the MicrosoftML Package

• Working with GitHub

• Introduction to Shiny

Page 79: A Two Hour Tour of the Tidyverse - London R · •The tidyverse is designed to work with tidy data •A single structure that is common to all of the packages •Makes it easy to

Aimee Gott – Senior Consultant

[email protected]

Next LondonR Workshop

Matching Your Brand with ggplot2: Working with

Scales, Themes and Guides