Please familiarise yourself with the forums FAQ: Homework Policy
That said, I believe its as simple as this.
make_inf_list_from <- function(startnum,indexnum){
function(indexnum) {
startnum+indexnum - 1
}
}
list_from_3 <- make_inf_list_from(3,1)
list_from_3(1)
list_from_3(2)
library(purrr)
(map_dbl(1:6,
list_from_3))
list_from_100 <- make_inf_list_from(100,1)
list_from_100(1)
list_from_100(2)
(map_dbl(1:6,
list_from_100))