map_chr_hack: Map given function, handle null as NA and flatten_chr()

Description Usage Arguments Details Author(s) Examples

Description

Map given function, handle null as NA and flatten_chr()

Usage

1
map_chr_hack(.x, .f, ...)

Arguments

.x

An interable data object

.f

A function to map over the data

...

Extra arguments to 'map()'

Details

Use this function to extract elements with NAs from a list of lists into a tibble.

Author(s)

Jennifer Bryan https://github.com/jennybc/

Examples

1
2
3
4
#data(animal_encounters)
#nn <- map_chr_hack(animal_encounters$content, c("properties", "name"))
#testthat::expect_true(is.na(nn[[1]]))
#testthat::expect_equal(nn[[2]], animal_encounters$content[[2]]$properties$name)

parksandwildlife/biosysR documentation built on May 15, 2019, 5:50 p.m.