purrr::pluck() is better than I had realized. ?purrr::pluck():

[pluck()] also accepts arbitrary accessor functions, i.e. functions that take an object and return some internal piece. […] Compare: accessor(x[[1]])$foo to pluck(x, 1, accessor, "foo").

Tags: ,

Posted:

Leave a comment