title: How can a attempt a call to rename and return the results even if there is an error?
body: <p>I would like to iterate over a list of data frames a rename function. Sometimes the DFs will be NULL.</p>
  <pre><code>lookup &lt;- list(
    'miles_per_gallon' = 'mpg',
    'cylinder' = 'cyl'
  )
  
  
  df1 &lt;- mtcars
  df2 &lt;- NULL
  
  index_name &lt;- function(df, lookup) {
    i1 &lt;- unlist(lookup) %in% names(df)
    names_lookup_sub &lt;- lookup[i1]
    df %&gt;% rename(!!! lookup[i1])
  }
  
     
  </code></pre>
  <p>Now putting the function to use:</p>
  <pre><code>df1 %&gt;% {try(index_name(.,lookup))} %&gt;% glimpse # works! Note the newly named features
  Rows: 32
  Columns: 11
  $ miles_per_gallon &lt;dbl&gt; 21.0, 21.0, 22.8, 21.4, 18.7, 18.1, 14.3, 24.4, 22.8, 19.2, 17.8, 16.4, 17.3, 15.2, 10.4, 10.4, 14…
  $ cylinder         &lt;dbl&gt; 6, 6, 4, 6, 8, 6, 8, 4, 4, 6, 6, 8, 8, 8, 8, 8, 8, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 8, 6, 8, 4
  $ disp             &lt;dbl&gt; 160.0, 160.0, 108.0, 258.0, 360.0, 225.0, 360.0, 146.7, 140.8, 167.6, 167.6, 275.8, 275.8, 275.8, …
  $ hp               &lt;dbl&gt; 110, 110, 93, 110, 175, 105, 245, 62, 95, 123, 123, 180, 180, 180, 205, 215, 230, 66, 52, 65, 97, …
  $ drat             &lt;dbl&gt; 3.90, 3.90, 3.85, 3.08, 3.15, 2.76, 3.21, 3.69, 3.92, 3.92, 3.92, 3.07, 3.07, 3.07, 2.93, 3.00, 3.…
  $ wt               &lt;dbl&gt; 2.620, 2.875, 2.320, 3.215, 3.440, 3.460, 3.570, 3.190, 3.150, 3.440, 3.440, 4.070, 3.730, 3.780, …
  $ qsec             &lt;dbl&gt; 16.46, 17.02, 18.61, 19.44, 17.02, 20.22, 15.84, 20.00, 22.90, 18.30, 18.90, 17.40, 17.60, 18.00, …
  $ vs               &lt;dbl&gt; 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1
  $ am               &lt;dbl&gt; 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1
  $ gear             &lt;dbl&gt; 4, 4, 4, 3, 3, 3, 3, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 4, 4, 4, 3, 3, 3, 3, 3, 4, 5, 5, 5, 5, 5, 4
  $ carb             &lt;dbl&gt; 4, 4, 1, 1, 2, 1, 4, 2, 2, 4, 4, 3, 3, 3, 4, 4, 4, 1, 2, 1, 1, 2, 2, 4, 2, 1, 2, 2, 4, 6, 8, 2
  </code></pre>
  <p>But when trying with the NULL DF:</p>
  <pre><code>df2 %&gt;% {try(index_name(.,lookup))} %&gt;% glimpse # error in UseMethod(&quot;rename_&quot;) : no applicable method for 'rename_' applied to an object of class &quot;NULL&quot;
  </code></pre>
  <p>How can I apply my function across several dataframes and apply the function where the df exists and otherwise pass over it without throwing an error?</p>