Is this conditional to the length of the string ? Like if only 5 digits, add 200 before ?
a = c("20013536", "20017954","19618","18114")
# iterate
purrr::map_chr(a, ~{
if (nchar(.x) == 5) paste0("200", .x) else .x
})
#> [1] "20013536" "20017954" "20019618" "20018114"
# vectorise
dplyr::if_else(nchar(a) == 5, paste0(200, a), a)
#> [1] "20013536" "20017954" "20019618" "20018114"
Created on 2020-08-20 by the reprex package (v0.3.0.9001)
If you can create a function pad_if_only_five() to apply each time you need.