#463 (in flight at time of writing) modifies search_content() to return a list of Connect class objects.
Right now, the best way to filter this list within R is to use purrr::keep(). Perhaps this is the best way, but perhaps there's a way we can make this easier.
my_content <- search_content(client, "owner:@me")
# > length(my_content)
# [1] 237
MINIMUM_R_VERSION <- "4.0"
# Use purrr::keep to filter with arbitrary predicates
old_content <- purrr::keep(my_content, function(x) {
isTRUE(as.numeric_version(x$content$r_version) < as.numeric_version(MINIMUM_R_VERSION))
})
length(old_content)
# [1] 48