transformTo: Transform coordinate system.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/transformTo.R

Description

Transforms (linear) coordinates from one coordinate system (defined by its range) into an other coordinate system (defined by its range).

Usage

1
transformTo(x, old.range = range(x), new.range)

Arguments

x

Coordinates in the old coordinate system that should be transformed.

old.range

The range (minimal and maximal value) of the old coordinate system.

new.range

The range of the coordinate system into which the values in x should be transformed.

Value

The values in x transformed into the new coordinate system.

Author(s)

Johannes Rainer

See Also

plotFeatures

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# transform x into a coordinate system ranging from 10 to 100.
# in this simple exampl the 1 is mapped to 10 and 8 to 100
x <- c( 1, 4, 2, 8 )
transformTo( x, new.range=c( 10, 100 ) )

y <- c( 1, 5, 10, 4 )

x-y
transformTo( x, old.range=range( c( x, y ) ), new.range=c( 10, 100 ) )

transformTo( x, old.range=range( c( x, y ) ), new.range=c( 10, 100 ) ) - transformTo( y, old.range=range( c( x, y ) ), new.range=c( 10, 100 ) )

jotsetung/GenomePlotR documentation built on May 19, 2019, 9:41 p.m.