squeeze {bggAnalytics} | R Documentation |
This acts similar to toString
function, but it tries to
make the string as short as possible by squeezing sequences of integers into
boundary values only. Please see the examples section. unsqueez
reverses this operation.
squeeze(integers)
unsqueeze(strings, strict = FALSE)
integers |
a numeric vector of integers. |
strings |
a character vector of strings, preferably outputs of
|
strict |
a logical value, decides whether the output should be strictly
a list. If |
squeeze
returns a vector of characters, unsqueeze
returns a list of numerics or a numeric vector.
Jakub Bujnowicz bujnowiczgithub@gmail.com
integers <- c(1, 3:5, NA, 27:38, 10:13, 9:11, 6)
squeeze(integers)
unsqueeze(squeeze(integers))
setdiff(na.omit(integers), unsqueeze(squeeze(integers)))