Description Usage Arguments Examples
View source: R/ShortFunctions.R
Get the unique set, convert it from list to vector, and then sort it
1 | SUU(thing)
|
thing |
thing to get a sorted, unlisted vector of. This is often a column of a data.table. |
1 2 3 4 5 6 7 8 9 10 | X = sample(x = letters[1:20], size = 30, replace = T, prob = (1:20)/sum(1:20))
Y = sample(x = letters[1:20], size = 30, replace = T, prob = (1:20)/sum(1:20))
Z = sample(x = letters[1:20], size = 30, replace = T, prob = (1:20)/sum(1:20))
thing1 = data.table(X = X, Y = Y, Z = Z, stringsAsFactors = F)
thing2 = thing1[,2,with = F]
thing3 = SUU(thing2)
print(thing3)
str(thing3)
SUU(thing1[,1,with = F])
SUU(thing1[,3,with = F])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.