Преглед изворни кода

allows multiple id-columns

-id1, -id2 work, id1:id2 does not (yet)
pull/10/head
David пре 7 година
родитељ
комит
259b44fcfa
2 измењених фајлова са 3 додато и 1 уклоњено
  1. +2
    -0
      R/animate_tidyr.R
  2. +1
    -1
      R/tidyr_helpers.R

+ 2
- 0
R/animate_tidyr.R Прегледај датотеку

# ids <- "" # ids <- ""
# what happens if ids := -year or ids := x:y # 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 %in% c(key, value)]
ids <- ids[ids != "-"] ids <- ids[ids != "-"]



+ 1
- 1
R/tidyr_helpers.R Прегледај датотеку

key_values <- x %>% pull(key) %>% unique() key_values <- x %>% pull(key) %>% unique()


type_dict <- c(rep("id", length(ids)), rep("key", length(key)), rep("value", length(value))) 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 x_dict <- 1:nc
names(x_dict) <- xn names(x_dict) <- xn

Loading…
Откажи
Сачувај