Я не знал, что сделала твоя функция getReviews
, поэтому вставил:
getReviews <- function(pp_id, country, page_num){
data.frame(pp_id, country, page_num)
}
Вот for
l oop.
output <- NULL # Best practice is to pre-declare
cases <- 1:10
for(i in seq_along(cases)){ # seq_along is better
output[[i]] <- getReviews(368677368, "us", i)
}
bind_rows(output)
Ссылка: R для Data Science , H Wickham, 1st ed, p 314