misc.tools | R Documentation |
Some misc functions.
combinations(..., link = "<<>>", data = NULL)
uncombine(x, n = 1, splt = "<<>>")
... |
Unspecified or additional arguments. For
|
link |
(character) For |
data |
(data.frame or similar) If supplied, the source for vectors to be combined. |
x |
(vector) For |
n |
(numeric) For |
splt |
(character) For |
combinations
and uncombine
return
vectors of combined or uncombined terms, respectively.
These are misc functions. They might need tidying
combinations
merges supplied vectors but assumes
the terms in the supplied vectors are equivalent. This
is a little of a specialist function but if you ever
have a case where e.g. you want to group journeys
between locations and need a-to-b and b-to-a to be
merged as a single case journeys-between-a-and-b...
uncombine
extracts terms from a previous combined
vector.
Katrina Hemingway and Karl Ropkins
a <- 1:5
b <- 5:1
#pasting combines two vectors
#making e.g. 1 + 5 and 5 + 1 unique cases
paste(a,b)
#combinations makes cases where these are equivalent
combinations(a,b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.