title: Mutate under multiple conditions with dplyr (NA and grep)
body: <p>I want to change the values in my data (<code>dat</code>) using <code>dplyr</code>. </p>
  
  <p>Here, the values of <code>First.name</code> should be changed. </p>
  
  <p>This should be done under the following conditions: If the values in Company have NA and if the values of Email have a certain string pattern I want to impute the Value "DELETE" otherwise the original values of the First.name should remain. </p>
  
  <pre><code>library(dplyr)
  
  dat %&gt;% 
      mutate(First.name = ifelse(
          is.na(Company) == T &amp; 
              ifelse(
                  grepl("web|google|gmail|gmx|hotmail|yahoo|t-online|freenet|aol|netscape|kabelmail|onlinehome|outlook", Email), 
                  "DELETE", 
                  First.name
              )
      ))
  </code></pre>
  
  <p>But I get this Error:</p>
  
  <pre><code>Error in mutate_impl(.data, dots) : Evaluation error: operations are possible only for numeric, logical or complex types.
  </code></pre>