Reducing my for loop usage with purrr::reduce()