alpha_num <- function(n){
pool <- c(letters,
LETTERS,
rep(0:9, length.out = length(letters)))
paste0(
sample(x = pool,
size = n,
replace = TRUE),
collapse = ""
)
}
alpha_num(1)
#> [1] "K"
alpha_num(10)
#> [1] "ur6Qo7eRr0"
alpha_num(20)
#> [1] "qKNLbPwQrrkDwugB8AAS"
Created on 2020-09-21 by the reprex package (v0.3.0)