Tidyverse is one suite of tools for data science
url <- "https://github.com/hadley/r4ds/raw/master/diagrams/data-science.png" knitr::include_graphics(url)
IMPORT (readr):
- read_csv()
- read_delim()
TIDY & TRANSFORM (dplyr):
- mutate()
adds new variables that are functions of existing variables
- select()
picks variables based on their names.
- filter()
picks cases based on their values.
- summarise()
reduces multiple values down to a single summary.
- arrange()
changes the ordering of the rows.
VISUALISE (ggplot): creating graphics, based on ‘The Grammar of Graphics’
- aes()
- geom_x()
+ layers
MODEL (broom):
- tidy()
, glance()
, augment()
url <- "https://s3-us-west-2.amazonaws.com/collections.lacma.org-images/remote_images/ma-150089-WEB.jpg" knitr::include_graphics(url)
magrittr
packageurl <- "https://github.com/tidyverse/magrittr/raw/master/man/figures/logo.png" knitr::include_graphics(url)
magrittr
packagemagrittr
package by Stefan Milton Bache developed the concept of the pipe, which is used heavily in the tidyverse
url <- "https://github.com/tidyverse/magrittr/raw/master/vignettes/magrittr.jpg" knitr::include_graphics(url)
The “pipe” is a sequence of functions, that are sequentially applied to an object
wakeup(self) %>% put_on("clothes") %>% eat("breakfast") %>% go(to = "work")
Alternative nested code:
go(eat(put_on(wakeup(self), "clothes"), "breakfast"), to = "work")
What does this code do?
wakeup(self) %>% put_on("clothes") %>% eat("breakfast") %>% fmk() %>% go(to = "work")
What does this code do?
morning_routine <- wakeup(self) %>% put_on("clothes") %>% eat("breakfast") %>% fmk() %>% go(to = "work")
What does this code do?
`r dataframe_name
%>%select(
r colnames(df_numeric_select)
, r colnames(df_character_select)
) %>%group_by(
r colnames(df_character_select)
) %>%summarize(mean(
r colnames(df_numeric_select)
))`
url <- "https://66.media.tumblr.com/tumblr_l7iwzq98rU1qa1c9eo1_500.jpg" knitr::include_graphics(url)
#change this to a good "and then" example url <- "https://github.com/rstudio-education/datascience-box/raw/master/slides/u1_d01-meet-the-toolkit/img/lego-steps.png" knitr::include_graphics(url)
https://datasciencebox.org
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.