sc_uid: Unique labels

View source: R/00_uid.R

sc_uidR Documentation

Unique labels

Description

Find unique labels for entities, or create them if not present.

Usage

sc_uid(x, ..., uid_nchar = NULL)

Arguments

x

number of unique IDs to generate

...

reserved for future use

uid_nchar

number of raw characters to paste as a uuid, default is 6 (only if silicate.uid.type is "uuid", see Details)

Details

If 'integers' default we generate sequential integers, it's assumed that all IDs are created at one time, we are not adding to an existing set. Code that adds IDs should find the largest existing ID and offset these by that value.

Using 'silicate.uid.type="uuid"' is the default. Using 'silicate.uid.type="integer"' is considered experimental. By default UIDs are a mix of letters, LETTERS and digits of length getOption("silicate.uid.size") which defaults to 6.

See ids package for random_id used if option 'silicate.uid.type="uuid"'.

Value

vector of unique id values for elements in the input

Examples

sc_uid(data.frame(1:10))

silicate documentation built on Jan. 7, 2023, 1:15 a.m.