extract_pairs {zenplots} | R Documentation |
Extract Pairs from a Path of Indices
Description
Extracts pairs from a path of indices, representing the path by the pairs (connected by common variable) and return a shortened path.
Usage
extract_pairs(x, n)
Arguments
x |
the path, a |
n |
A |
Value
returns an object of the same type as the input
x
but (possibly) shortened. It extracts the first/last so-many
pairs of x
.
Author(s)
Marius Hofert and Wayne Oldford
See Also
zenplot()
which provides the zenplot.
Other tools related to constructing zenpaths:
connect_pairs()
,
graph_pairs()
,
groupData()
,
indexData()
,
zenpath()
Examples
## Begin with a path
(zp <- zenpath(c(3, 5), method = "eulerian.cross")) # integer(2) argument
## Extract the first two pairs and last four of indices
extract_pairs(zp, n = c(2, 4))
## Extract the first and last three pairs of indices
extract_pairs(zp, n = 3) # the 3 is repeated automatically