Skip to content
Prev 242258 / 398500 Next

how to apply sample function to each row of a data frame?

this is a simple question, but I wasn't able to figure it out myself. 

here is the data frame:

M P Q
1 2 3
4 5 6
7 8 9

M, P, Q each represent a variable

I want to draw 2 random sample from each row separately to create a new data
frame. how can I do it?

thanks!!