title: error: Aesthetics must either be length one, or the same length as the dataProblems:personCategoryz when omitting NA
body: <p>I'm trying to create a graph using titanic dataset that looks at women, children, and men and their survival rates. I've created new categories to read the data from, but keep coming up with error messages when i try to do more beyond that point. </p>
  
  <p>When I run a graph to show this, it comes up fine except it has a separate category for NA data, so I tried to omit the data and the error message "Aesthetics must either be length one, or the same length as the dataProblems:personCategoryz" comes up. </p>
  
  <p>Here is what I do that is fine for the most part, with the exception of showing NA data: </p>
  
  <pre><code>titanic$personCategoryx[titanic$Age &lt; 14] &lt;-1 
  titanic$personCategoryx[titanic$Age &gt; 13 &amp; titanic$Sex=="female"] &lt;-2
  titanic$personCategoryx[titanic$Age &gt; 13 &amp; titanic$Sex=="male"] &lt;-3
  titanic$personCategory &lt;- factor(titanic$personCategoryx, labels=c("children", "women", "men"))
  ggplot(titanic) + geom_bar(aes(x=personCategory, fill=factor(Survived)))
  </code></pre>
  
  <p>here is what I put in that gives me the error message:</p>
  
  <pre><code>titanic$personCategoryx[titanic$Age &lt; 14] &lt;-1 
  titanic$personCategoryx[titanic$Age &gt; 13 &amp; titanic$Sex=="female"] &lt;-2
  titanic$personCategoryx[titanic$Age &gt; 13 &amp; titanic$Sex=="male"] &lt;-3
  titanic$personCategory &lt;- factor(titanic$personCategoryx, labels=c("children", "women", "men"))
  
  personCategoryz &lt;- na.omit(titanic$personCategory)
  summary(personCategoryz)
  
  ggplot(titanic) + geom_bar(aes(x=personCategoryz, fill=factor(Survived)))
  </code></pre>
  
  <p>How would I go about fixing this? Thanks!</p>