How to split data into training and validation in R? : <p>The question says:</p>

<p>Load the data and split it into 75% training and 25% validation data using set.seed(4650).</p>

<p>this is what I have:</p>

<pre><code>setwd("C:/Users/Downloads")
cat = read.csv("cat.csv")
set.seed(4650)
train = sample(c(TRUE, TRUE, TRUE, FALSE), nrow(cat), rep = TRUE)
validation = (!train)
</code></pre>

<p>And I need to provide summary of the training data.</p>

<pre><code>summary(train)
</code></pre>

<p>which gives me</p>

<pre><code>Mode       FALSE   TRUE
logical    830     2463
</code></pre>

<p>Am I splitting the data in the right way?</p>

<p>Thank you very much.</p>
