-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
^LICENSE\.md$ | ||
^\.github$ | ||
^cran-comments\.md$ | ||
^CRAN-SUBMISSION$ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,13 +8,18 @@ Authors@R: | |
email = "[email protected]", | ||
comment = c(ORCID = "0000-0001-5215-0316")) | ||
Description: Visualize your 'Tidyverse' data analysis pipelines via the | ||
'Tidy Data Tutor' web application. | ||
'Tidy Data Tutor'(<https://tidydatatutor.com/>) web application. | ||
License: MIT + file LICENSE | ||
URL: https://github.com/seankross/tidydatatutor | ||
BugReports: https://github.com/seankross/tidydatatutor/issues | ||
Encoding: UTF-8 | ||
Imports: | ||
Imports: | ||
clipr, | ||
knitr, | ||
rstudioapi | ||
RoxygenNote: 7.1.2 | ||
Suggests: | ||
rmarkdown, | ||
dplyr, | ||
testthat (>= 3.0.0) | ||
Config/testthat/edition: 3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
library(dplyr) | ||
|
||
mtcars %>% | ||
select(mpg, cyl, hp) %>% | ||
group_by(cyl) %>% | ||
summarise(mean(hp)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
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) %>% | ||
summarise(mean(hp)) | ||
``` | ||
|
||
[See this pipeline in Tidy Data Tutor](`r tdt_chunk("mtcars-1")`) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
library(dplyr) | ||
|
||
mtcars %>% | ||
select(mpg, cyl, hp) %>% | ||
group_by(cyl) %>% | ||
summarise(mean(hp)) | ||
|
||
## # A tibble: 3 × 2 | ||
## cyl `mean(hp)` | ||
## <dbl> <dbl> | ||
## 1 4 82.6 | ||
## 2 6 122. | ||
## 3 8 209. | ||
|
||
[See this pipeline in Tidy Data | ||
Tutor](https://tidydatatutor.com/vis.html#code=library%28dplyr%29%0A%0Amtcars%20%25%3E%25%20%0A%20%20select%28mpg%2C%20cyl%2C%20hp%29%20%25%3E%25%20%0A%20%20group_by%28cyl%29%20%25%3E%25%20%0A%20%20summarise%28mean%28hp%29%29&d=2021-12-09&lang=r&v=v1) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
test_that("tdt_url makes the correct url", { | ||
test_that("tdt_link makes the correct url", { | ||
|
||
input <- c("library(dplyr)", "library(palmerpenguins)", "", "penguins %>%", | ||
" select(species, bill_length_mm) %>%", " group_by(species) %>%", | ||
" arrange(desc(bill_length_mm), .by_group = TRUE) %>% ", " slice(1)" | ||
) | ||
correct <- paste0("https://tidydatatutor.com/vis.html#code=library%28dplyr%29%0Alibrary%28palmerpenguins%29%0A%0Apenguins%20%25%3E%25%0A%20%20select%28species%2C%20bill_length_mm%29%20%25%3E%25%0A%20%20group_by%28species%29%20%25%3E%25%0A%20%20arrange%28desc%28bill_length_mm%29%2C%20.by_group%20%3D%20TRUE%29%20%25%3E%25%20%0A%20%20slice%281%29&d=", | ||
as.character(Sys.Date()), "&lang=r&v=v1") | ||
expect_equal(correct, tdt_url(input)) | ||
expect_equal(correct, tdt_link(input)) | ||
}) |