For a df data frame, you can get df.new as:
df.new = df[seq(1, nrow(df), 5), ]
This creates an index from row 1 to nrow (the number of rows in the table) every 5 rows. You can play with a starting point, and 5 can be used to highlight other sequences.
source
share