pairwise | R Documentation |
Reorder strings so that strings that start with the same characters appear next to each other
pairwise(x, starts = defaultStarts(x, split), split = "_")
x |
vector of character |
starts |
vector of character defining the start strings that are looked
for in |
split |
split character used to create default |
x <- c("a.1", "b_hi", "c", "a.2", "d", "b_bye")
# You have the most control when setting the starts argument
pairwise(x, starts = c("a.", "b_"))
# Use default starts resulting from splitting at a split character
pairwise(x, split = "_")
# This is actually the default
pairwise(x)
# Note that the split parameter is interpreted as a pattern where the
# dot has a special meaning unless it is escaped or enclosed in []
pairwise(x, split = "[.]")
# Same result as in the first example
pairwise(x, split = "[._]")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.