seq_zeros | R Documentation |
Create sequences of numbers like seq()
or seq_len()
but with zeros prefixed to
keep numerical order
seq_zeros(seq_length, num_zeros = NULL)
seq_length |
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 |
num_zeros |
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
# Using number
new_seq <- seq_zeros(seq_length = 15, num_zeros = 1)
new_seq
# Sequence with 2 zeros
new_seq <- seq_zeros(seq_length = 1:15, num_zeros = 2)
new_seq
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.