Learn R Programming

diyar (version 0.4.0)

overlaps: Overlapping number line objects

Description

Identify overlapping number_line objects

Usage

overlaps(x, y, methods = 8)

overlap(x, y)

exact(x, y)

reverse(x, y)

across(x, y)

chain(x, y)

aligns_start(x, y)

aligns_end(x, y)

inbetween(x, y)

overlap_method(x, y)

include_overlap_method(methods)

exclude_overlap_method(methods)

overlap_method_codes(methods)

Arguments

methods

[charater|integer]. Methods of overlap. Check different pairs of number_line objects by different methods. Options are "exact", "reverse", "inbetween", "across", "chain", "aligns_start" and "aligns_end". Combinations are also supported see diyar::overlap_methods$options.

Value

logical; character

Details

9 logical test;

exact() - Identical left and right points.

reverse() - Swapped left and right points.

inbetween() - start and end point of one number_line object is within the start and end point of another.

across() - start or end point of one number_line object is in between the start and end point of another.

chain() - endpoint of one number_line object is the same as the start point of another.

aligns_start() - identical start points only.

aligns_end() - identical end point only.

overlap() - any kind of overlap. A convenient method for "ANY" and "ALL" methods of overlap.

overlaps() - overlap by a specified combination of the methods.

Describe methods of overlap;

overlap_method() - Shows how a pair of number_line object has overlapped. Does not show "overlap" since overlap() is always TRUE when any other method is TRUE.

include_overlap_method() and exclude_overlap_method() - Conveniently create the required values for methods, and case_overlap_methods and recurrence_overlap_methods in episodes.

overlap_method_codes() - Numeric codes for the supported combination of overlap methods.

See Also

number_line; set_operations

Examples

Run this code
# NOT RUN {
a <- number_line(-100, 100)
b <- number_line(10, 11.2)
c <- number_line(100, 200)
d <- number_line(100, 120)
e <- number_line(50, 120)
g <- number_line(100, 100)
f <- number_line(120, 50)

overlaps(a, g)
overlaps(a, g, methods = "exact|chain")

overlap(a, b)
overlap(a, e)

exact(a, g)
exact(a, a)

reverse(e, e)
reverse(e, f)

across(a, b)
across(a, e)

chain(c, d)
chain(a, c)

aligns_start(c, d)
aligns_start(a, c)

aligns_end(d, e)
aligns_end(a, c)

inbetween(a, g)
inbetween(b, a)

overlap_method(a, c)
overlap_method(d, c)
overlap_method(a, g)
overlap_method(b, e)

include_overlap_method("across")
include_overlap_method(c("across", "chain"))

exclude_overlap_method("across")
exclude_overlap_method(c("across", "chain"))

overlap_method_codes("across")
overlap_method_codes("across|chain|exact")
# }

Run the code above in your browser using DataLab