a typo or copy/paste issue in this line df <- mutate(df, id=str_pad(id, 6, "left")). In addition, for long numbers, user must set scipen so that number is not turned to e notation, with str_pad. str_pad has some weird behavior (from user point of view, if scipen is not set)
> str_pad(10000,8, "right", pad=0)
[1] "10000000"
> str_pad(100000, 7, "right", pad=0)
[1] "1e+0500"
> str_pad(1234000000, 7, "right", pad=0)
[1] "1.234e+09"