S4ForceFlat: Force an vector to be flat

Description Usage Arguments Details Value Functions Examples

Description

This is typically the last step when a geom requests a coordinate system to transform the data values between a numeric range between 0 and 1.

Usage

1
S4ForceFlat(x, limits = NULL, aes = "z")

Arguments

x

A vector

limits

A representation of limits

aes

An aesthetic for which to evaluate the flattening.

Details

When using a ranged class as x argument, the result can be evaluated differently depending on the aes argument. For example, when x is an IRanges class, setting aes = "xmin" gives rescaled start values and aes = "xmax" gives rescaled end values.

Value

A numeric vector with values between 0-1

Functions

Examples

1
2
3
4
5
6
7
8
S4ForceFlat(1:5, limits = c(1, 5))

# Range classes give different results based on the aes argument
require(GenomicRanges)
value  <- GRanges(c("chr1:10-20", "chr2:10-20"))
limits <- GRanges(c("chr1:1-30", "chr2:1-30"))
S4ForceFlat(value, limits, aes = "xmin")
S4ForceFlat(value, limits, aes = "xmax")

teunbrand/ggnomics documentation built on Aug. 2, 2020, 7:34 p.m.