title: Split into training and testing set in R?
body: <p><strong>How can I write the following written code in python into R ?</strong></p>
  <pre><code>X_train, X_test, y_train, y_test = train_test_split(X, y, 
                                                      test_size=0.2, random_state=42)   
  </code></pre>
  <p>Spliting into training and testing set 80/20 ratio.</p>