R/empty_fill.R

Defines functions empty_fill_dbl empty_fill_chr empty_fill

empty_fill = function(x) {

  x %>% purrr::map_if(is_empty, ~ NA_character_)

}

empty_fill_chr = function(x) {

  x %>% purrr::map_if(is_empty, ~ NA_character_) %>% purrr::flatten_chr()

}

empty_fill_dbl = function(x) {

  x %>% purrr::map_if(is_empty, ~ NA_real_) %>% purrr::flatten_dbl()

}
jhnwllr/gbifapi documentation built on April 30, 2022, 12:55 p.m.