Rolling mean lag function for multiple variables
Answering my own question here, but certainly open to suggestions.

library(RcppRoll)

# Loop through n = 10
for (i in 1:10){

  # Create custom col labels
  lab1 &lt;- paste0("x_", i)
  lab2 &lt;- paste0("x2_", i)
  lab3 &lt;- paste0("x3_", i)

  # Loop through each fips and calculate rollingmean
  dat &lt;- dat %&gt;%
      group_by(fips) %&gt;%
      mutate(!!lab1 := roll_mean(x, i, align = "left", fill = "NA"),
             !!lab2 := roll_mean(x2, i, align = "left", fill = "NA"),
             !!lab3 := roll_mean(x3, i, align = "left", fill = "NA")) %&gt;% 
    ungroup()

  # Progress bar for loop
  print(i)
}


&gt; names(dat)
 [1] "fips"  "x"     "x2"    "x3"    "x_1"   "x2_1"  "x3_1"  "x_2"   "x2_2"  "x3_2"  "x_3"   "x2_3" 
[13] "x3_3"  "x_4"   "x2_4"  "x3_4"  "x_5"   "x2_5"  "x3_5"  "x_6"   "x2_6"  "x3_6"  "x_7"   "x2_7" 
[25] "x3_7"  "x_8"   "x2_8"  "x3_8"  "x_9"   "x2_9"  "x3_9"  "x_10"  "x2_10" "x3_10"