We expand the data by uncounting, then grouped by 'ID', get the sequence from the first 'Date' to the number of rows (n()) while incrementing by 1
library(tidyverse)
df1 %>%
uncount(3) %>%
group_by(ID) %>%
mutate(Date = seq(Date[1], length.out = n(), by = 1))
# A tibble: 9 x 2
# Groups: ID [3]
# ID Date
# <int> <dbl>
#1 1 17228
#2 1 17229
#3 1 17230
#4 2 17226
#5 2 17227
#6 2 17228
#7 3 17230
#8 3 17231
#9 3 17232
Or another option is unnest a list column
df1 %>%
group_by(ID) %>%
mutate(Date = list(Date[1] + 0:2)) %>%
unnest
Or with complete
df1 %>%
group_by(ID) %>%
complete(Date = first(Date) + 0:2)
Or using base R (pasteing from the comments)
within(df1[rep(seq_len(nrow(df1)), each = 3),], Date <- Date + 0:2)
Or more compactly in data.table
library(data.table)
setDT(df1)[, .(Date = Date + 0:2), ID]