title: R For Loop iteration number when using non-numeric identifiers
body: <p>I have a for loop that creates a series of maps for each of the unique crimes types in a list. These maps are then exported to a powerpoint presentation <code>pres_1</code>.</p>
  <pre><code>for(i in unique(crime_df$crime_type)) {
    crime_map &lt;- ggplot(data = filter(crime_df, crime_type== i)) + 
      geom_sf(aes(geometry = geometry, fill = curr_yr_count))
  pres_1 &lt;- add_slide(pres_1, layout = &quot;Title and Content&quot;, master = &quot;Office Theme&quot;)
  pres_1 &lt;- ph_with(pres_1, value = crime_map, location = ph_location_type(type = &quot;body&quot;))
  }
  </code></pre>
  <p>I would like to move the map slides to elsewhere within the presentation, based on the iteration number of the loop - e.g. the first map produced should go to slide 20, the second to slide 22 etc.
  However, the value of <code>i</code> refers to the value of <code>crime_type</code>, which is non-numeric (e.g. robbery etc.).</p>
  <p>Is there any way to get the numeric value of <code>i</code> so I could add the following line of code to the end of the loop?  <code>pres_1 &lt;- move_slide(pres_1, index = length(pres_1), to = 22 + i)</code></p>