Description Usage Arguments Details Value See Also Examples
partial_unique
makes given characters as short as posssible while preserving uniqueness.
1 | partial_unique(originalv = c("mpg", "cyl", "disp", "hp", "drat"), i = 1)
|
originalv |
a character vector to construct partial strings. |
i |
The smallest character of the resulted partial strings.
Sometimes too small i loses readability
such as in |
partial_unique
is a variant of R's builtin unique
function.
While link[base]{unique}
returns the non-duplicated set of elements,
partial_unique
returns a list whose element names are partially unique shortest strings,
and its element values are original strings.
This function can display how many characters
are needed to uniquely identify each given character element.
a list whose element names are partial strings and element values are original strings.
unique
, show_dataset_column_indices
1 2 3 | partial_unique(c("Sepal.Width", "Sepal.Length", "Species", "Petal.Width"))
# returns list(Sepal.W = "Sepal.Width", Sepal.L = "Sepal.Length",
# Sp = "Species", P = "Petal.Width")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.