title: How to solve error "Too few observations." when using ROSE to balancing data in R?
body: <p>I try to use ROSE library on R to rebalancing target variable in my dataset.
  Here is my information of my dataset.</p>
  
  <ul>
  <li>My original dataset have total 132056 records.</li>
  <li>There are total 279 cases (0.21%) of minor class in target variable.</li>
  <li>There are total 131777 cases (99.79%) of major class in target variable.</li>
  </ul>
  
  <p>I would like to undersampling the dataset to make the percentage of minor class increase to 5%.</p>
  
  <p>Here is my code :</p>
  
  <pre><code>df_Under &lt;- ovun.sample(Target ~ ., data = df, method = "under", N =5580, seed = 1)
  </code></pre>
  
  <p>However, after run the code above, I got the following error message.</p>
  
  <pre><code>"Error in (function (formula, data, method, subset, na.action, N, p = 0.5,  :Too few observations." 
  </code></pre>
  
  <p>I tried play with other method of ROSE such as "over" and "both" but there are the same error occurs.</p>
  
  <p>How can I fixed this problem ?</p>
  
  <p>Kind regards,</p>