Connect R and RStudio to Tidy Data Tutor.
You can install the latest release version of tidydatatutor from CRAN:
install.packages("tidydatatutor")
You can install the development version of tidydatatutor from GitHub with:
# install.packages("remotes")
remotes::install_github("seankross/tidydatatutor")
Send a string of code to Tidy Data Tutor:
code =
"library(dplyr)
library(palmerpenguins)
penguins %>%
select(species, bill_length_mm) %>%
group_by(species) %>%
arrange(desc(bill_length_mm), .by_group = TRUE) %>%
slice(1)"
tidydatatutor::go_code(code)
Copy the following code into the clipboard:
library(dplyr)
library(palmerpenguins)
penguins %>%
select(species, bill_length_mm) %>%
group_by(species) %>%
arrange(desc(bill_length_mm), .by_group = TRUE) %>%
slice(1)
Then open it in Tidy Data Tutor by running this in the console:
tidydatatutor::go_paste()
Generate links to Tidy Data Tutor in R Markdown with named R code chunks:
---
output: md_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(message = FALSE)
library(tidydatatutor)
```
```{r mtcars-1}
library(dplyr)
mtcars %>%
select(mpg, cyl, hp) %>%
group_by(cyl) %>%
summarize(mean(hp))
```
[See this pipeline in Tidy Data Tutor](`r tdt_chunk("mtcars-1")`)
Access Tidy Data Tutor from the Addins drop down menu in RStudio: