Message view | « Date » · « Thread » |
---|---|
Top | « Date » · « Thread » |
From | arijit chakraborty <ak...@hotmail.com> |
Subject | Randomly Selecting rows from a dataframe |
Date | Fri, 21 Apr 2017 20:42:50 GMT |
Hi, Suppose I've a dataframe of 10 variables (X1-X10) and have 1000 rows. Now I want to randomly select rows so that I've a subset of the dataset. Can anyone please help me to solve this problem? I tried the following code: randSample = sample(nrow(dataframe), 200); This gives me a column matrix with position of the row randomly selected. But I could not able to solve how from this matrix I can subset data from original dataframe. Thank you! Arijit | |
Mime |
|
View raw message |