R4DS error comparison (1) is possible only for atomic and list types : <p>In R4DS Section 3.6, the authors present the following code:</p>

<pre><code>ggplot(data = mpg, mapping = aes(x = displ, y = hwy)) + 
  geom_point(mapping = aes(color = class)) + 
  geom_smooth(data = filter(mpg, class == "subcompact"), se = FALSE)
</code></pre>

<p>which causes the following error</p>

<pre><code>Error in class == "subcompact" : 
  comparison (1) is possible only for atomic and list types
</code></pre>

<p>I assume it worked when the authors wrote it, as they have a nice plot illustrating the results. </p>

<p>What is happening and how do I fix it? (R 3.3.2 on OS X)
Thanks</p>
