extracting data from a deeply nested list

I was going to suggest the use of purrr::pluck(), then then reading through the doco I discovered you could actually just use a purrr::map().

You’re very close: you need to pass a list of accessors to map() rather than a character vector, and there’s an accessor you’ve missed.

nestedlist %>% map( list('data', 1, 'name') )

[1] "john"

[1] "litz"

[1] "frank"

[1] "doe"

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top