Consider this example
list('test', 'one')
I would like to subset this list and only keep the longest string in the list. Using purrr::keep does not seem to work.
> list('test', 'one') %>% keep(~ nchar(.x) == max(nchar(.)))
[[1]]
[1] "test"
[[2]]
[1] "one"
Any ideas? Thanks!