uniqueP | R Documentation |
Paste a character vector's unique values into a single string.
uniqueP(x, collapse="; ", sort=TRUE)
x |
character vector. |
collapse |
character string to be pasted between |
sort |
|
vec = c("apple","banana","banana","corn","corn","tomato") uniqueP(vec) #Use with \emph{data.table} syntax dt = data.table(group=c("A","A","A","B","B","B","B"), name=c("Mary","Mary","Jim","Bill","Fred","Bill","Anne")) dt[, uniqueP(name), by=.(group)]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.