Here is another option using dplyr, where we first count the number of observations for each ID, then filter to keep only the IDs with at least 2 observations, then remove the count column.
library(dplyr)
df %>%
add_count(ID, name = "obs") %>%
filter(obs > 1) %>%
select(-obs)
Output
ID score Time
1 2 1000000 1
2 2 1000000 2
3 3 1000000 1
4 3 1000000 2
5 5 1000000 1
6 5 1000000 2
Or another option using data.table:
library(data.table)
setDT(df)[,if(.N > 1) .SD, by=ID]
Data
df <- structure(list(ID = c(1L, 2L, 2L, 3L, 3L, 4L, 5L, 5L), score = c(1000000L,
1000000L, 1000000L, 1000000L, 1000000L, 1000000L, 1000000L, 1000000L
), Time = c(1L, 1L, 2L, 1L, 2L, 1L, 1L, 2L)), class = "data.frame", row.names = c(NA,
-8L))