title: Faster way to subset on rows of a data frame in R?
body: <p>I have been using these 2 methods interchangeably to subset data from a data frame in R.<br>
  Method 1<br>
      <code>subset_df &lt;- df[which(df$age&gt;5) , ]</code><br>
  Method 2<br>
      <code>subset_df &lt;- subset(df, age&gt;5)</code></p>
  
  <p>I had 2 questions belonging to these.<br>
  1. Which one is faster considering I have very large data?<br>
  2. This post here <a href="https://stackoverflow.com/questions/14639595/subsetting-data-frames-in-r">Subsetting data frames in R</a> suggests that there is in fact difference between above 2 methods. One of them handles NA accurately. Which one is safe to use then?</p>