Learn R Programming

HilbertCurve (version 1.2.2)

hc_segments-HilbertCurve-method: Add line segments to Hilbert curve

Description

Add line segments to Hilbert curve

Usage

## S3 method for class 'HilbertCurve':
hc_segments(object, ir, x1 = NULL, x2 = NULL,
    gp = gpar(lty = 1, lwd = 1, col = 1))

Arguments

object
ir
an IRanges object which specifies the input intervals.
x1
if start positions are not integers, they can be set by x1.
x2
if end positions are not integers, they can be set by x2.
gp
graphic parameters for lines. It should be specified by gpar. Note you cannot set linejoin and lineend.

Value

  • A data frame which contains coordinates (in the 2D space) of segments.

Examples

Run this code
hc = HilbertCurve(1, 100, level = 4, reference = TRUE)

x = sort(sample(100, 20))
s = x[1:10*2 - 1]
e = x[1:10*2]
ir = IRanges(s, e)

hc_segments(hc, ir)

Run the code above in your browser using DataLab