iv_align | R Documentation |
iv_align()
will align/join needles
and haystack
together using a data
frame of locations
. These locations
are intended to be the output of one
of: iv_locate_overlaps()
, iv_locate_precedes()
, iv_locate_follows()
,
iv_locate_relates()
, or iv_locate_between()
.
This is mainly a convenience function that slices both needles
and
haystack
according to those locations
, and then stores the result
in a new two column data frame.
iv_align(needles, haystack, ..., locations)
needles, haystack |
Two vectors to align. |
... |
These dots are for future extensions and must be empty. |
locations |
The data frame of locations returned from one of |
A two column data frame with a $needles
column containing the
sliced version of needles
and a $haystack
column containing the sliced
version of haystack
.
needles <- iv_pairs(c(1, 5), c(3, 7), c(10, 12)) haystack <- iv_pairs(c(0, 2), c(4, 6)) locations <- iv_locate_overlaps(needles, haystack) iv_align(needles, haystack, locations = locations) locations <- iv_locate_overlaps(needles, haystack, no_match = "drop") iv_align(needles, haystack, locations = locations) needles <- c(1, 15, 4, 11) haystack <- iv_pairs(c(1, 5), c(3, 7), c(10, 12)) locations <- iv_locate_between(needles, haystack) iv_align(needles, haystack, locations = locations)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.