Description Usage Arguments Value Author(s) See Also Examples
Transforms (linear) coordinates from one coordinate system (defined by its range) into an other coordinate system (defined by its range).
1 | transformTo(x, old.range = range(x), new.range)
|
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 |
The values in x
transformed into the new coordinate system.
Johannes Rainer
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 ) )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.