uuid | R Documentation |
A UUID is usually considered 32 lowercase hexadecimal digits displayed in five groups separated by hyphens (a total of 36 characters). The number of characters in the five groups are 8-4-4-4-12. There are about 3.4 x 10 ^ 38 possible UUID combinations, therefore it is unlikely that two UUIDs will be identical.
uuid(uppercase = FALSE, sep = "-")
uuid_rowwise(df)
uppercase |
Should the letters be returned as uppercase? Default
is |
sep |
What character should separate the five groups of characters? Default is hyphens (-). |
df |
Input data frame for row-wise transformation. |
base::sample
is used as the random number generator. Random-base
UUIDs are sometimes called version 4 UUIDs.
The uuid_rowwise
function uses replicate
so a variable/column
in a data frame with unique uuids can be generated conveniently.
Christopher Bare, modified by Stuart K. Grange Originally from: http://gist.github.com/cbare/5979354
sample
, replicate
## Not run:
# Get a single identifier
identifier <- uuid()
# Print
identifier
"8e7675d5-4a87-4e0b-ae9b-9c97819aace5"
# Generate unique uuids for every row in a data frame
data_ozone$uuid <- uuid_rowwise(data_ozone)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.