hc_segments-HilbertCurve-method {HilbertCurve} | R Documentation

## Add line segments to Hilbert curve

### Description

Add line segments to Hilbert curve

### Usage

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

### Arguments

`object` | A `HilbertCurve-class` 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.

### Author(s)

Zuguang Gu <z.gu@dkfz.de>

### Examples

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

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

    hc_segments(hc, ir)

[Package HilbertCurve version 1.24.0 Index]