well this is extremely weird because I also tried this solution:
tibble(mytext = list(list('rstudio is nice', 'rstats is cool'),
list('this stuff is incredible', 'hello world'))) %>%
mutate(subsample = map(mytext, ~purrr::keep(.x, str_detect(.x,'rstudio')))) %>%
mutate(flag = map_dbl(mytext, ~purrr::some(mytext, ~str_detect(.x,'rstudio'))))
# A tibble: 2 x 3
mytext subsample flag
<list> <list> <dbl>
1 <list [2]> <list [1]> 1
2 <list [2]> <list [0]> 1
Why is it working for you when the call is wrapped into a function? Is this a bug?
Thanks!