title: why does map_if() not work within a list
body: <p>Please help me</p>
  
  <p>1) Why does map_if not work within a list<br>
  2) Is there a way to make it work<br>
  3) If not, what are the alternatives</p>
  
  <p>Thanks in advance.</p>
  
  <pre><code>library(dplyr) 
  library(purrr) 
  
  cyl &lt;- split(mtcars, mtcars$cyl) 
  
  # This works
  map_if(mtcars, is.numeric, mean) 
  
  # This does not work 
  map_if(cyl, is.numeric, mean)
  </code></pre>