# Splitting a matrix

#### Taibo

##### New Member
Hi,

I have a matrix x with 97 rows and used the function sample like this :

rownumbers=sample(1:97,size=70)
data1=x[rownumbers,]

I'm having trouble to get the rows which are not inside data1 into another matrix.
Does anyone have an idea?

greets,
Taibo

#### Dason

x$id = 0 x$id[rownumbers] = 1