Przeglądaj źródła

Adjust font sizes in animate_gather/spread

And change Long/Wide to lowercase to reflect that they are both variables names and a description of the state of the data.
pull/18/merge
Garrick Aden-Buie 7 lat temu
rodzic
commit
183f6d34f4
5 zmienionych plików z 6 dodań i 4 usunięć
  1. +4
    -4
      R/animate_tidyr.R
  2. +1
    -0
      README.Rmd
  3. +1
    -0
      README.md
  4. BIN
      man/figures/tidyexplain-gather-1.gif
  5. BIN
      man/figures/tidyexplain-spread-1.gif

+ 4
- 4
R/animate_tidyr.R Wyświetl plik

@@ -46,8 +46,8 @@ animate_gather <- function(w, key, value, ..., export = "gif", detailed = TRUE)
id_string <- paste0(", ", paste(sprintf("-%s", ids), collapse = ", "))

sequence <- c(
current_state = "Wide",
final_state = "Long",
current_state = "wide",
final_state = "long",
operation = sprintf("gather(%s, %s, %s%s)",
wname,
dput_parser(key),
@@ -109,8 +109,8 @@ animate_spread <- function(l, key, value, export = "gif", detailed = TRUE, ...)
id_string <- paste0(", ", paste(sprintf("-%s", ids), collapse = ", "))

sequence <- c(
current_state = "Long",
final_state = "Wide",
current_state = "long",
final_state = "wide",
operation = sprintf("spread(%s, %s, %s)",
lname,
dput_parser(key),

+ 1
- 0
README.Rmd Wyświetl plik

@@ -306,6 +306,7 @@ wide <- data_frame(
> 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 gather}
set_font_size(4.5, 15)
animate_gather(wide, key = "person", value = "sales", -year)
```


+ 1
- 0
README.md Wyświetl plik

@@ -430,6 +430,7 @@ wide <- data_frame(
> of a variable.

``` r
set_font_size(4.5, 15)
animate_gather(wide, key = "person", value = "sales", -year)
```


BIN
man/figures/tidyexplain-gather-1.gif Wyświetl plik

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

BIN
man/figures/tidyexplain-spread-1.gif Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz