Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

How do I get the non-selected rownumbers?

$
0
0

I created a training and testing subset from my original data:

df <- data.frame(var = seq(1, 200, by = 2))
train.rows <- sample(1:100, 75, replace = FALSE)
df.train <- df[train.rows,]
df.test <- df[-train.rows,]

How can I see the numbers of the rows from the original dataframe (df) that I selected to be in df.test? (To see the ones that I selected to be in df.train, I would just check out trains.rows. But that is not possible for -train.rows)

Edit: the title is about the fact that I specify/select rows for a training set and now I just want to know the ones that I didn't select for the training set


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>