View source: R/make_nested_id.R
make_nested_id | R Documentation |
Generate a numeric identifier attempting to be stable to changes within groups.
make_nested_id(..., outer = TRUE)
... |
Either a single data.frame (or similar object) or something that can be coerced to a data.frame. |
outer |
Don't touch this (it controls recursion). |
The objective of this function is to make identifiers that are generally insensitive to changes within other groups. The only time that identifiers will change for groups that do not have changes is if one level of identifiers has a new order of magnitude (e.g. if the number of unique values within one of the groups goes from 99 to 100).
Values are converted to integers with 'as.integer(factor(x))'. To gain more control over the order, set values to factors prior to calling this function.
An integer vector with unique identifiers that are nested with numbers indicating group identifiers in a way that is stable to changes within other groups.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.