I am trying to use the lead function on R, where basically the last value in `val.test` corresponding to the group `var` becomes the first value in `val.test.lead`

```
set.seed(14)
df <- data.frame(
  var = c("A","B","C","D","E","F","G","H","I","J","K","L"),
  val.test = rnorm(12,4,5)
)

df$var <- as.factor(df$var)

df <- df %>% 
  dplyr::group_by(var) %>% 
  dplyr::mutate(val.test.lead = lead(val.test, default = first(val.test)))

#The output is

  var   val.test val.test.lead
   <fct>    <dbl>         <dbl>
 1 A        0.691         0.691
 2 B       12.6          12.6  
 3 C       14.6          14.6  
 4 D       11.5          11.5  
 5 E        3.82          3.82 
 6 F       10.2          10.2  
 7 G        3.68          3.68 
 8 H        9.34          9.34 
 9 I        2.12          2.12 
10 J        9.22          9.22 
11 K        2.09          2.09 
12 L        5.50          5.50 

```

#The expected output is

```
  var   val.test val.test.lead
   <fct>    <dbl>         <dbl>
 1 A        0.691         5.50
 2 B       12.6           0.691 
 3 C       14.6           12.6
 4 D       11.5           14.6 
 5 E        3.82          11.5
 6 F       10.2           3.82 
 7 G        3.68          10.2
 8 H        9.34          3.68  
 9 I        2.12          9.34 
10 J        9.22          2.12 
11 K        2.09          9.22 
12 L        5.50          2.09 

```