Explorar el Código

allows multiple id-columns

-id1, -id2 work, id1:id2 does not (yet)
pull/10/head
David hace 7 años
padre
commit
259b44fcfa
Se han modificado 2 ficheros con 3 adiciones y 1 borrados
  1. +2
    -0
      R/animate_tidyr.R
  2. +1
    -1
      R/tidyr_helpers.R

+ 2
- 0
R/animate_tidyr.R Ver fichero

@@ -38,6 +38,8 @@ animate_gather <- function(w, key, value, ..., export = "gif", detailed = TRUE)
# ids <- ""
# what happens if ids := -year or ids := x:y

# the case that ... contains two -arguments. i.e., -year, -region
ids <- ids[2, ]
ids <- ids[!ids %in% c(key, value)]
ids <- ids[ids != "-"]


+ 1
- 1
R/tidyr_helpers.R Ver fichero

@@ -178,7 +178,7 @@ process_long <- function(x, ids, key, value, ...) {
key_values <- x %>% pull(key) %>% unique()

type_dict <- c(rep("id", length(ids)), rep("key", length(key)), rep("value", length(value)))
names(type_dict) <- c(rep(ids, length(ids)), rep(key, length(key)), rep(value, length(value)))
names(type_dict) <- c(ids, key, value)

x_dict <- 1:nc
names(x_dict) <- xn

Cargando…
Cancelar
Guardar