gather_nvec | R Documentation |
Given a named vector, produce a list that gathers the elements of the vector with the same name into a list where each element takes these unique names.
gather_nvec(vec)
vec |
Named vector |
List with elements being a unique name in the input vector
John Best
vec <- c(1, 1, 1, 1, 2, 2, 2, 3, 3, 4) names(vec) <- c("a", "a", "a", "a", "b", "b", "b", "c", "c", "d") gather_nvec(vec)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.