title: How to use case_when for a list
body: <p>I have a list as follows:</p>
  
  <pre><code>   tryout&lt;- list(c("stomach:biopsy", ",colon:biopsy", ",stomach:biopsy"), 
          character(0), character(0), "oesophagus:biopsy", character(0), 
          character(0))
  </code></pre>
  
  <p>I want to replace the term <code>"stomach:biopsy"</code> with the number 1. I want to do this with  <code>case_when</code> from <code>dplyr</code></p>
  
  <p>I have tried:</p>
  
  <pre><code>lapply(tryout, function(x) 
      x %&gt;% 
             mutate(group = case_when( 
               grepl("stomach:biopsy",x ) ~ 1
             )))
  </code></pre>
  
  <p>but I get the error:</p>
  
  <pre><code>Error in UseMethod("mutate_") : 
    no applicable method for 'mutate_' applied to an object of class "character"
  </code></pre>
  
  <p>So how can I run the case_when for a nested list?</p>