1

I am using the sample function to extract rows from a dataframe (dat) with 1010 rows. By using:

idx <- sample(1:nrow(dat), 707))

I extract 707 indices at random. How can I easily get the complement of such indexes? That is, the numbers from 1 to 1010 that were not chosen and are not in idx.

0 Answers0