title: From apply to purrr's pmap
body: <p>I'm currently switching my apply functions to purrr. I've had help with a couple commands, but as soon as a degree of complexity is added, I'm thrown for a loop. I'm wondering what the purrr alternative is to the code below. The goal is to find the most recent year a score was registered, for each row, using the column names. Once again, I give the functional (apply) code.</p>
  
  <pre><code>dat = data.frame('SCORE_2010'=c(0,0,1,0),'SCORE_2011'=c(1,0,1,0),'SCORE_2012'=c(0,0,1,0),'SCORE_2013'=c(1,0,0,1))
  
  dat[,'L_YEAR'] = apply(dat[,grepl('^SCORE_[0-9]+',names(dat))],
                         1,
                         function(x) 
                           ifelse(length(which(x==1))&gt;0,str_extract(names(dat)[max(which(x==1))],'[0-9]+'),0)
                         )
  </code></pre>