Quellcode durchsuchen

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 vor 7 Jahren
Ursprung
Commit
183f6d34f4
5 geänderte Dateien mit 6 neuen und 4 gelöschten Zeilen
  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 Datei anzeigen

id_string <- paste0(", ", paste(sprintf("-%s", ids), collapse = ", ")) id_string <- paste0(", ", paste(sprintf("-%s", ids), collapse = ", "))


sequence <- c( sequence <- c(
current_state = "Wide",
final_state = "Long",
current_state = "wide",
final_state = "long",
operation = sprintf("gather(%s, %s, %s%s)", operation = sprintf("gather(%s, %s, %s%s)",
wname, wname,
dput_parser(key), dput_parser(key),
id_string <- paste0(", ", paste(sprintf("-%s", ids), collapse = ", ")) id_string <- paste0(", ", paste(sprintf("-%s", ids), collapse = ", "))


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

+ 1
- 0
README.Rmd Datei anzeigen

> 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. > 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} ```{r gather}
set_font_size(4.5, 15)
animate_gather(wide, key = "person", value = "sales", -year) animate_gather(wide, key = "person", value = "sales", -year)
``` ```



+ 1
- 0
README.md Datei anzeigen

> of a variable. > of a variable.


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



BIN
man/figures/tidyexplain-gather-1.gif Datei anzeigen

Vorher Nachher
Breite: 480  |  Höhe: 480  |  Größe: 906KB Breite: 480  |  Höhe: 480  |  Größe: 572KB

BIN
man/figures/tidyexplain-spread-1.gif Datei anzeigen

Vorher Nachher
Breite: 480  |  Höhe: 480  |  Größe: 949KB Breite: 480  |  Höhe: 480  |  Größe: 585KB

Laden…
Abbrechen
Speichern