rescale {EpiTxDb} | R Documentation

## Rescaling `Ranges` object

### Description

`rescale()` rescales `IRanges`, `GRanges`, `IRangesList` and `GRangesList` by using minima and maxima derived from `to` and `from`.

### Usage

    rescale(x, to = 1L, from = 1L)

    ## S4 method for signature 'IRanges'
    rescale(x, to = 1L, from = 1L)

    ## S4 method for signature 'IRangesList'
    rescale(x, to = 1L, from = 1L)

    ## S4 method for signature 'GRanges'
    rescale(x, to = 1L, from = 1L)

    ## S4 method for signature 'GRangesList'
    rescale(x, to = 1L, from = 1L)

### Arguments

`x` | a `IRanges`, `GRanges`, `IRangesList` and `GRangesList` object
`to, from` | an `IRanges` object, a `character` vector coercible to `IRanges` or a `integer` vector parallel to `x` or with `length = 1L`.

### Value

an object of the same type and dimensions as `x`

### Author(s)

H. Pagès, F. Ernst

### See Also

`IRanges` for details on `character` vectors coercible to `IRanges`.

### Examples

    x <- IRanges("5-10")
    # widen the ranges
    rescale(x, 100, 10)
    # widen and shift
    rescale(x, "31-60", "5-14")

[Package EpiTxDb version 1.4.0 Index]