title: Generate list of datasets with randomly selected features in R
body: <p>I have a dataset with 20 features. I wish to create a list of datasets with random subsets of features from the original data set.
  For example - <code>[dataset[, c(1,3,4)], dataset[, c(2,3,5,11,20)]]</code>.</p>
  
  <p>I am trying the following code for the same</p>
  
  <pre><code>selectors = array(runif(2000), dim=c(100, 20, 1))
  list_datasets = vector("list", 100)
  i = 1
  while(i &lt; 100)
    list_datasets[[i]] = dataset[, selectors[i,,1] &gt; 0.5]
    i = i + 1
  </code></pre>
  
  <p>Here, my <code>dataset</code> has 20 features and I need 100 datasets with random features out of these 20 features. So I have created <code>selectors</code> array, by initially creating a vector of size 2000 with random values and then making it 100*20. In the <code>while</code> loop, I have then tried to add a feature to <code>list_datasets[[i]]</code> only if random value generated for it was greater than 0.5 . Hopefully, I was able to explain myself</p>
  
  <p>But this is very slow. I am new to R and want to know what is the best way to achieve what I am trying to do.</p>