seq_zeros(seq_length, num_zeros = NULL)
a seqeunce or numbers of numbers to create sequence.
Users can provide sequence (1:XX) or number of values to add in sequence (will
be used as second number in seq_len
; 1:XX).
number of zeros to prefix sequence, default is (e.g, 01, 02, 03, ...)
vector of numbers in sequence
Base code from stackoverflow post: https://stackoverflow.com/a/38825614
# Using sequence
new_seq <- seq_zeros(seq_length = 1:15, num_zeros = 1)
new_seq
#> [1] "01" "02" "03" "04" "05" "06" "07" "08" "09" "10" "11" "12" "13" "14" "15"
# Using number
new_seq <- seq_zeros(seq_length = 15, num_zeros = 1)
new_seq
#> [1] "01" "02" "03" "04" "05" "06" "07" "08" "09" "10" "11" "12" "13" "14" "15"
# Sequence with 2 zeros
new_seq <- seq_zeros(seq_length = 1:15, num_zeros = 2)
new_seq
#> [1] "001" "002" "003" "004" "005" "006" "007" "008" "009" "010" "011" "012"
#> [13] "013" "014" "015"