Sfoglia il codice sorgente

Test tidyexplain name and update README

Sets figure output to man/figures/tidyexplain- and ensures that all R chunks that output figures are named. This gives a collection of animations and static images with reasonable names ready for download and use.
pull/18/merge
Garrick Aden-Buie 7 anni fa
parent
commit
cb3c44bbb3
38 ha cambiato i file con 83 aggiunte e 75 eliminazioni
  1. +6
    -5
      DESCRIPTION
  2. +45
    -42
      README.Rmd
  3. +26
    -23
      README.md
  4. BIN
      README_files/figure-gfm/anti-join-1.gif
  5. BIN
      README_files/figure-gfm/full-join-1.gif
  6. BIN
      README_files/figure-gfm/inner-join-1.gif
  7. BIN
      README_files/figure-gfm/intersect-1.gif
  8. BIN
      README_files/figure-gfm/intial-dfs-1.png
  9. BIN
      README_files/figure-gfm/intial-dfs-so-1.png
  10. BIN
      README_files/figure-gfm/left-join-1.gif
  11. BIN
      README_files/figure-gfm/left-join-extra-1.gif
  12. BIN
      README_files/figure-gfm/right-join-1.gif
  13. BIN
      README_files/figure-gfm/semi-join-1.gif
  14. BIN
      README_files/figure-gfm/setdiff-1.gif
  15. BIN
      README_files/figure-gfm/union-1.gif
  16. BIN
      README_files/figure-gfm/union-all-1.gif
  17. BIN
      README_files/figure-gfm/unnamed-chunk-12-1.gif
  18. BIN
      README_files/figure-gfm/unnamed-chunk-16-1.gif
  19. BIN
      README_files/figure-gfm/unnamed-chunk-18-1.gif
  20. BIN
      README_files/figure-gfm/unnamed-chunk-20-1.gif
  21. BIN
      man/figures/tidyexplain-anti-join-1.gif
  22. BIN
      man/figures/tidyexplain-full-join-1.gif
  23. BIN
      man/figures/tidyexplain-gather-1.gif
  24. BIN
      man/figures/tidyexplain-inner-join-1.gif
  25. BIN
      man/figures/tidyexplain-intersect-1.gif
  26. BIN
      man/figures/tidyexplain-intial-dfs-1.png
  27. BIN
      man/figures/tidyexplain-intial-dfs-so-1.png
  28. BIN
      man/figures/tidyexplain-left-join-1.gif
  29. BIN
      man/figures/tidyexplain-left-join-extra-1.gif
  30. BIN
      man/figures/tidyexplain-right-join-1.gif
  31. BIN
      man/figures/tidyexplain-semi-join-1.gif
  32. BIN
      man/figures/tidyexplain-setdiff-1.gif
  33. BIN
      man/figures/tidyexplain-setdiff-y-x-1.gif
  34. BIN
      man/figures/tidyexplain-spread-1.gif
  35. BIN
      man/figures/tidyexplain-union-1.gif
  36. BIN
      man/figures/tidyexplain-union-all-1.gif
  37. BIN
      man/figures/tidyexplain-union-y-x-1.gif
  38. +6
    -5
      man/tidyexplain-package.Rd

+ 6
- 5
DESCRIPTION Vedi File

@@ -1,6 +1,6 @@
Type: Package
Package: tidyverbs
Title: Animate the Verbs of the Tidyverse
Package: tidyexplain
Title: Animated Explanations of Tidyverse Verbs
Version: 0.0.1.9000
Date: 2018-08-27
Authors@R:
@@ -15,7 +15,8 @@ Authors@R:
person(given = "Tyler Grant",
family = "Smith",
role = "ctb"))
Description: Animate the verbs of the tidyverse.
Description: Animated explanations of the verbs in the tidyverse
using gganimate and ggplot2.
License: MIT + file LICENSE
Depends:
gganimate (>= 0.9.9.9999),
@@ -29,8 +30,8 @@ Imports:
Suggests:
knitr,
roxygen2,
viridis,
testthat
testthat,
viridis
VignetteBuilder:
knitr
Encoding: UTF-8

+ 45
- 42
README.Rmd Vedi File

@@ -1,5 +1,7 @@
---
output: github_document
editor_options:
chunk_output_type: console
---

<!-- README.md is generated from README.Rmd. Please edit that file -->
@@ -11,9 +13,12 @@ knitr::opts_chunk$set(
echo = TRUE,
warning = FALSE,
message = FALSE,
fig.path = "man/figures/tidyexplain-",
cache = TRUE
)
library(tidyAnimatedVerbs)
library(dplyr)
library(tidyexplain)
set_font_size(11, 26)
```

[gganimate]: https://github.com/thomasp85/gganimate#README
@@ -38,8 +43,8 @@ Garrick Aden-Buie -- [&commat;grrrck](https://twitter.com/grrrck) -- [garrickade
- Tidyr Operations: [`gather()`](#gather), [`spread()`](#spread)

- Learn more about
- [Relational Data](#relational-data)
- [gganimate](#gganimate)
- [Relational Data](#relational-data)
- [gganimate](#gganimate)


Please feel free to use these images for teaching or learning about action verbs from the [tidyverse](https://tidyverse.org).
@@ -50,16 +55,18 @@ Currently, the animations cover the [dplyr two-table verbs][dplyr-two-table] and

## Installing

The library can be installed with
```{r, echo=T,eval=F}
The in-development version of `tidyexplain` can be installed with `devtools`:

```r
# install.package("devtools")
devtools::install_github("gadenbuie/tidy-animated-verbs")

library(tidyexplain)
```

## Mutating Joins

```{r intial-dfs, echo=T}
library(tidyAnimatedVerbs)
```{r intial-dfs}
x <- data_frame(
id = 1:3,
x = paste0("x", 1:3)
@@ -74,7 +81,7 @@ animate_full_join(x, y, by = c("id"), export = "first")
```


```{r echo=TRUE}
```{r}
x
y
```
@@ -83,12 +90,12 @@ y

> All rows from `x` where there are matching values in `y`, and all columns from `x` and `y`.

```{r inner-join, echo=T}
```{r inner-join}
animate_inner_join(x, y, by = "id")
```


```{r echo=TRUE}
```{r}
inner_join(x, y, by = "id")
```

@@ -96,12 +103,12 @@ inner_join(x, y, by = "id")

> All rows from `x`, and all columns from `x` and `y`. Rows in `x` with no match in `y` will have `NA` values in the new columns.

```{r left-join, echo=T}
```{r left-join}
animate_left_join(x, y, by = "id")
```


```{r echo=TRUE}
```{r}
left_join(x, y, by = "id")
```

@@ -109,14 +116,14 @@ left_join(x, y, by = "id")

> ... If there are multiple matches between `x` and `y`, all combinations of the matches are returned.

```{r left-join-extra, echo=T}
```{r left-join-extra}
y_extra <- bind_rows(y, data_frame(id = 2, y = "y5"))
y_extra # has multiple rows with the key from `x`

animate_left_join(x, y_extra, by = "id")
```

```{r echo=TRUE}
```{r}
left_join(x, y_extra, by = "id")
```

@@ -124,12 +131,12 @@ left_join(x, y_extra, by = "id")

> All rows from y, and all columns from `x` and `y`. Rows in `y` with no match in `x` will have `NA` values in the new columns.

```{r right-join, echo = T}
```{r right-join}
animate_right_join(x, y, by = "id")
```


```{r echo=TRUE}
```{r}
right_join(x, y, by = "id")
```

@@ -137,12 +144,12 @@ right_join(x, y, by = "id")

> All rows and all columns from both `x` and `y`. Where there are not matching values, returns `NA` for the one missing.

```{r full-join, echo=T}
```{r full-join}
animate_full_join(x, y, by = "id")
```


```{r echo=TRUE}
```{r}
full_join(x, y, by = "id")
```

@@ -152,12 +159,12 @@ full_join(x, y, by = "id")

> All rows from `x` where there are matching values in `y`, keeping just columns from `x`.

```{r semi-join, echo=T}
```{r semi-join}
animate_semi_join(x, y, by = "id")
```


```{r echo=TRUE}
```{r}
semi_join(x, y, by = "id")
```

@@ -165,18 +172,18 @@ semi_join(x, y, by = "id")

> All rows from `x` where there are not matching values in `y`, keeping just columns from `x`.

```{r anti-join, echo=T}
```{r anti-join}
animate_anti_join(x, y, by = "id")
```


```{r echo=TRUE}
```{r}
anti_join(x, y, by = "id")
```

## Set Operations

```{r intial-dfs-so, echo=T}
```{r intial-dfs-so}
x <- data_frame(
x = c(1, 1, 2),
y = c("a", "b", "a")
@@ -190,7 +197,7 @@ animate_union(x, y, export = "first")
```


```{r echo=TRUE}
```{r}
x
y
```
@@ -199,18 +206,18 @@ y

> All unique rows from `x` and `y`.

```{r union, echo=T}
```{r union}
animate_union(x, y)
```


```{r echo=TRUE}
```{r}
union(x, y)
```



```{r echo=TRUE}
```{r union-y-x}
animate_union(y, x)

union(y, x)
@@ -220,13 +227,13 @@ union(y, x)

> All rows from `x` and `y`, keeping duplicates.

```{r union-all, echo=T}
```{r union-all}
animate_union_all(x, y)
```



```{r echo=TRUE}
```{r}
union_all(x, y)
```

@@ -235,12 +242,12 @@ union_all(x, y)

> Common rows in both `x` and `y`, keeping just unique rows.

```{r intersect, echo=T}
```{r intersect}
animate_intersect(x, y)
```


```{r echo=TRUE}
```{r}
intersect(x, y)
```

@@ -248,17 +255,17 @@ intersect(x, y)

> All rows from `x` which are not also rows in `y`, keeping just unique rows.

```{r setdiff, echo=T}
```{r setdiff}
animate_setdiff(x, y)
```


```{r echo=TRUE}
```{r}
setdiff(x, y)
```


```{r echo=TRUE}
```{r setdiff-y-x}
animate_setdiff(y, x)

setdiff(y, x)
@@ -279,6 +286,8 @@ to be formatted as a tidy dataset and the
you organize your data into tidy data.

```{r}
library(tidyr)

long <- data_frame(
year = c(2010, 2011, 2010, 2011, 2010, 2011),
person = c("Alice", "Alice", "Bob", "Bob", "Charlie", "Charlie"),
@@ -292,12 +301,11 @@ wide <- data_frame(
)
```


### Gather

> Gather takes multiple columns and collapses into key-value pairs, duplicating all other columns as needed. You use gather() when you notice that your column names are not names of variables, but values of a variable.

```{r}
```{r gather}
animate_gather(wide, key = "person", value = "sales", -year)
```

@@ -305,13 +313,11 @@ animate_gather(wide, key = "person", value = "sales", -year)
gather(wide, key = "person", value = "sales", -year)
```



### Spread

> Spread a key-value pair across multiple columns. Use it when an a column contains observations from multiple variables.

```{r}
```{r spread}
animate_spread(long, key = "person", value = "sales")
```

@@ -320,9 +326,6 @@ spread(long, key = "person", value = "sales")
```





## Learn More

### Relational Data

+ 26
- 23
README.md Vedi File

@@ -25,10 +25,9 @@ Smith](https://github.com/TylerGrantSmith).
- Tidyr Operations: [`gather()`](#gather), [`spread()`](#spread)

- Learn more about

- [Relational Data](#relational-data)

- [gganimate](#gganimate)
- [Relational Data](#relational-data)
- [gganimate](#gganimate)

Please feel free to use these images for teaching or learning about
action verbs from the [tidyverse](https://tidyverse.org). You can
@@ -44,17 +43,19 @@ welcome\!](https://github.com/gadenbuie/tidy-animated-verbs/issues)

## Installing

The library can be installed with
The in-development version of `tidyexplain` can be installed with
`devtools`:

``` r
# install.package("devtools")
devtools::install_github("gadenbuie/tidy-animated-verbs")

library(tidyexplain)
```

## Mutating Joins

``` r
library(tidyAnimatedVerbs)
x <- data_frame(
id = 1:3,
x = paste0("x", 1:3)
@@ -68,7 +69,7 @@ y <- data_frame(
animate_full_join(x, y, by = c("id"), export = "first")
```

![](README_files/figure-gfm/intial-dfs-1.png)<!-- -->
![](man/figures/tidyexplain-intial-dfs-1.png)<!-- -->

``` r
x
@@ -96,7 +97,7 @@ y
animate_inner_join(x, y, by = "id")
```

![](README_files/figure-gfm/inner-join-1.gif)<!-- -->
![](man/figures/tidyexplain-inner-join-1.gif)<!-- -->

``` r
inner_join(x, y, by = "id")
@@ -116,7 +117,7 @@ inner_join(x, y, by = "id")
animate_left_join(x, y, by = "id")
```

![](README_files/figure-gfm/left-join-1.gif)<!-- -->
![](man/figures/tidyexplain-left-join-1.gif)<!-- -->

``` r
left_join(x, y, by = "id")
@@ -147,7 +148,7 @@ y_extra # has multiple rows with the key from `x`
animate_left_join(x, y_extra, by = "id")
```

![](README_files/figure-gfm/left-join-extra-1.gif)<!-- -->
![](man/figures/tidyexplain-left-join-extra-1.gif)<!-- -->

``` r
left_join(x, y_extra, by = "id")
@@ -169,7 +170,7 @@ left_join(x, y_extra, by = "id")
animate_right_join(x, y, by = "id")
```

![](README_files/figure-gfm/right-join-1.gif)<!-- -->
![](man/figures/tidyexplain-right-join-1.gif)<!-- -->

``` r
right_join(x, y, by = "id")
@@ -190,7 +191,7 @@ right_join(x, y, by = "id")
animate_full_join(x, y, by = "id")
```

![](README_files/figure-gfm/full-join-1.gif)<!-- -->
![](man/figures/tidyexplain-full-join-1.gif)<!-- -->

``` r
full_join(x, y, by = "id")
@@ -214,7 +215,7 @@ full_join(x, y, by = "id")
animate_semi_join(x, y, by = "id")
```

![](README_files/figure-gfm/semi-join-1.gif)<!-- -->
![](man/figures/tidyexplain-semi-join-1.gif)<!-- -->

``` r
semi_join(x, y, by = "id")
@@ -234,7 +235,7 @@ semi_join(x, y, by = "id")
animate_anti_join(x, y, by = "id")
```

![](README_files/figure-gfm/anti-join-1.gif)<!-- -->
![](man/figures/tidyexplain-anti-join-1.gif)<!-- -->

``` r
anti_join(x, y, by = "id")
@@ -259,7 +260,7 @@ y <- data_frame(
animate_union(x, y, export = "first")
```

![](README_files/figure-gfm/intial-dfs-so-1.png)<!-- -->
![](man/figures/tidyexplain-intial-dfs-so-1.png)<!-- -->

``` r
x
@@ -285,7 +286,7 @@ y
animate_union(x, y)
```

![](README_files/figure-gfm/union-1.gif)<!-- -->
![](man/figures/tidyexplain-union-1.gif)<!-- -->

``` r
union(x, y)
@@ -302,7 +303,7 @@ union(x, y)
animate_union(y, x)
```

![](README_files/figure-gfm/unnamed-chunk-12-1.gif)<!-- -->
![](man/figures/tidyexplain-union-y-x-1.gif)<!-- -->

``` r

@@ -324,7 +325,7 @@ union(y, x)
animate_union_all(x, y)
```

![](README_files/figure-gfm/union-all-1.gif)<!-- -->
![](man/figures/tidyexplain-union-all-1.gif)<!-- -->

``` r
union_all(x, y)
@@ -346,7 +347,7 @@ union_all(x, y)
animate_intersect(x, y)
```

![](README_files/figure-gfm/intersect-1.gif)<!-- -->
![](man/figures/tidyexplain-intersect-1.gif)<!-- -->

``` r
intersect(x, y)
@@ -365,7 +366,7 @@ intersect(x, y)
animate_setdiff(x, y)
```

![](README_files/figure-gfm/setdiff-1.gif)<!-- -->
![](man/figures/tidyexplain-setdiff-1.gif)<!-- -->

``` r
setdiff(x, y)
@@ -380,7 +381,7 @@ setdiff(x, y)
animate_setdiff(y, x)
```

![](README_files/figure-gfm/unnamed-chunk-16-1.gif)<!-- -->
![](man/figures/tidyexplain-setdiff-y-x-1.gif)<!-- -->

``` r

@@ -406,6 +407,8 @@ to be formatted as a tidy dataset and the
you organize your data into tidy data.

``` r
library(tidyr)

long <- data_frame(
year = c(2010, 2011, 2010, 2011, 2010, 2011),
person = c("Alice", "Alice", "Bob", "Bob", "Charlie", "Charlie"),
@@ -430,7 +433,7 @@ wide <- data_frame(
animate_gather(wide, key = "person", value = "sales", -year)
```

![](README_files/figure-gfm/unnamed-chunk-18-1.gif)<!-- -->
![](man/figures/tidyexplain-gather-1.gif)<!-- -->

``` r
gather(wide, key = "person", value = "sales", -year)
@@ -454,7 +457,7 @@ gather(wide, key = "person", value = "sales", -year)
animate_spread(long, key = "person", value = "sales")
```

![](README_files/figure-gfm/unnamed-chunk-20-1.gif)<!-- -->
![](man/figures/tidyexplain-spread-1.gif)<!-- -->

``` r
spread(long, key = "person", value = "sales")

BIN
README_files/figure-gfm/anti-join-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 610KB

BIN
README_files/figure-gfm/full-join-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 618KB

BIN
README_files/figure-gfm/inner-join-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 619KB

BIN
README_files/figure-gfm/intersect-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 477KB

BIN
README_files/figure-gfm/intial-dfs-1.png Vedi File

Before After
Width: 672  |  Height: 480  |  Size: 9.5KB

BIN
README_files/figure-gfm/intial-dfs-so-1.png Vedi File

Before After
Width: 672  |  Height: 480  |  Size: 6.4KB

BIN
README_files/figure-gfm/left-join-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 632KB

BIN
README_files/figure-gfm/left-join-extra-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 713KB

BIN
README_files/figure-gfm/right-join-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 641KB

BIN
README_files/figure-gfm/semi-join-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 607KB

BIN
README_files/figure-gfm/setdiff-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 523KB

BIN
README_files/figure-gfm/union-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 486KB

BIN
README_files/figure-gfm/union-all-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 467KB

BIN
README_files/figure-gfm/unnamed-chunk-12-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 483KB

BIN
README_files/figure-gfm/unnamed-chunk-16-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 492KB

BIN
README_files/figure-gfm/unnamed-chunk-18-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 702KB

BIN
README_files/figure-gfm/unnamed-chunk-20-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 713KB

BIN
man/figures/tidyexplain-anti-join-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 724KB

BIN
man/figures/tidyexplain-full-join-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 743KB

BIN
man/figures/tidyexplain-gather-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 906KB

BIN
man/figures/tidyexplain-inner-join-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 746KB

BIN
man/figures/tidyexplain-intersect-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 555KB

BIN
man/figures/tidyexplain-intial-dfs-1.png Vedi File

Before After
Width: 672  |  Height: 480  |  Size: 21KB

BIN
man/figures/tidyexplain-intial-dfs-so-1.png Vedi File

Before After
Width: 672  |  Height: 480  |  Size: 16KB

BIN
man/figures/tidyexplain-left-join-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 747KB

BIN
man/figures/tidyexplain-left-join-extra-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 861KB

BIN
man/figures/tidyexplain-right-join-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 758KB

BIN
man/figures/tidyexplain-semi-join-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 718KB

BIN
man/figures/tidyexplain-setdiff-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 596KB

BIN
man/figures/tidyexplain-setdiff-y-x-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 567KB

BIN
man/figures/tidyexplain-spread-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 949KB

BIN
man/figures/tidyexplain-union-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 571KB

BIN
man/figures/tidyexplain-union-all-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 560KB

BIN
man/figures/tidyexplain-union-y-x-1.gif Vedi File

Before After
Width: 480  |  Height: 480  |  Size: 565KB

man/tidyverbs-package.Rd → man/tidyexplain-package.Rd Vedi File

@@ -1,12 +1,13 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/zzzz-package.R
\docType{package}
\name{tidyverbs-package}
\alias{tidyverbs}
\alias{tidyverbs-package}
\title{tidyverbs: Animate the Verbs of the Tidyverse}
\name{tidyexplain-package}
\alias{tidyexplain}
\alias{tidyexplain-package}
\title{tidyexplain: Animated Explanations of Tidyverse Verbs}
\description{
Animate the verbs of the tidyverse.
Animated explanations of the verbs in the tidyverse
using gganimate and ggplot2.
}
\author{
\strong{Maintainer}: Garrick Aden-Buie \email{g.adenbuie@gmail.com}

Loading…
Annulla
Salva