Predict() for range of observations?

try


council.age = 0:20

if you want each line to have a vector of numbers 1 through 20

UPDATE: ignore above. I really should ignore questions without of a reprex. See the FAQ.

Assuming that you want to take a source data frame x and create a subset y

set.seed(42)
ages <- data.frame(age = sample(0:75, 100, replace = TRUE))
(young <- ages[which(ages$age %in% 0:20),])
#>  [1] 17 19  2  4  2 14  7 17  3  5  5  1  2 20  1  9  4  8 15  1 17 20 17 12  0
#> [26] 12  4 15 13  5
1 Like