title: Why is `[` better than `subset`?
body: <p>When I need to filter a data.frame, i.e., extract rows that meet certain conditions, I prefer to use the <code>subset</code> function:</p>
  <pre><code>subset(airquality, Month == 8 &amp; Temp &gt; 90)
  </code></pre>
  <p>Rather than the <code>[</code> function:</p>
  <pre><code>airquality[airquality$Month == 8 &amp; airquality$Temp &gt; 90, ]
  </code></pre>
  <p>There are two main reasons for my preference:</p>
  <ol>
  <li><p>I find the code reads better, from left to right. Even people who know nothing about R could tell what the <code>subset</code> statement above is doing.</p>
  </li>
  <li><p>Because columns can be referred to as variables in the <code>select</code> expression, I can save a few keystrokes. In my example above, I only had to type <code>airquality</code> once with <code>subset</code>, but three times with <code>[</code>.</p>
  </li>
  </ol>
  <p>So I was living happy, using <code>subset</code> everywhere because it is shorter and reads better, even advocating its beauty to my fellow R coders. But yesterday my world broke apart. While reading the <code>subset</code> documentation, I notice this section:</p>
  <blockquote>
  <p>Warning</p>
  <p>This is a convenience function intended for use interactively. For programming it is better to use the standard subsetting functions like [, and in particular the non-standard evaluation of argument subset can have unanticipated consequences.</p>
  </blockquote>
  <p>Could someone help clarify what the authors mean?</p>
  <p>First, what do they mean by &quot;<em>for use interactively</em>&quot;? I know what an interactive session is, as opposed to a script run in BATCH mode but I don't see what difference it should make.</p>
  <p>Then, could you please explain &quot;<em>the non-standard evaluation of argument subset</em>&quot; and why it is dangerous, maybe provide an example?</p>