Explorar el Código

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 hace 8 años
padre
commit
183f6d34f4
Se han modificado 5 ficheros con 6 adiciones y 4 borrados
  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 Ver fichero

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 Ver fichero

> 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 Ver fichero

> 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 Ver fichero

Antes Después
Anchura: 480  |  Altura: 480  |  Tamaño: 906KB Anchura: 480  |  Altura: 480  |  Tamaño: 572KB

BIN
man/figures/tidyexplain-spread-1.gif Ver fichero

Antes Después
Anchura: 480  |  Altura: 480  |  Tamaño: 949KB Anchura: 480  |  Altura: 480  |  Tamaño: 585KB

Cargando…
Cancelar
Guardar