Description Usage Arguments Value Warning Note See Also Examples
id
- Generate a sequential character
vector of
zero-padded identification numbers (IDs).
id_factor
- Generate a sequential factor
vector
of zero-padded identification numbers (IDs).
1 2 3 |
n |
The number elements to generate. This can be globally set within
the environment of |
random |
logical. If |
name |
The name to assign to the output vector's |
Returns a (optionally random) vector of
character
/factor
observations
ID numbers.
id
uses sprintf
to generate the
padded ID. Per sprintf
's documentation: “The format
string is passed down the OS's sprintf function...The behaviour on inputs not
documented here is 'undefined', which means it is allowed to differ by
platform.” See sprintf
for details.
id
is faster than id_factor
, as the later coerces the
vector to a factor
.
1 2 | id(1000)
r_data_frame(n=21, id)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.