I have similar dataset like this
structure(list(id = c(1, 1, 1, 1), time1 = c(1682, 1682, 1683,
1683)), class = "data.frame", row.names = c(NA, -4L))
and I want to create an extra column (column 2) where the maximum value (taken from time1 column) is repeated for the id column
structure(list(id = c(1, 1, 1, 1), time1 = c(1682, 1682, 1683,
1683), time2 = c(1683, 1683, 1683, 1683)), class = "data.frame", row.names = c(NA, -4L))