R/mask_data.R

Defines functions mask_data

# for sharing data
mask_data <- function(d) {
  validate_cells(d)
  if (hasName(d, "type")) {
    d0 <- d %>% mutate(value = recode(type, attribute = "A", value = "0", empty = ""))
  } else {
    d0 <- d %>% mutate(value = recode(data_type, character = "A", numeric = "0"))
  }
  as_tibble(d0)
}

Try the tidycells package in your browser

Any scripts or data that you put into this service are public.

tidycells documentation built on March 26, 2020, 7:35 p.m.