scale.ts: Rescale the y values of a (multi-)time series (ts) object

View source: R/timeseries.R

scale.tsR Documentation

Rescale the y values of a (multi-)time series (ts) object

Description

Linearly rescale y values to map range[1] to 0 and range[2] to 1. Values outside this range will be <0 and >1 respectively.

Usage

## S3 method for class 'ts'
scale(x, center = min(x), scale = diff(range(x)))

Arguments

x

A ts ormts object

center

Value to map to 0 (defaults to the minimum value of yrange)

scale

Defaults to ymax-ymin

Value

return value Single time series (ts)

See Also

ts

Examples

w<-read.pxp(system.file("igor","WedJul407c2_001.pxp",package="IgorR"))
wts<-WaveToTimeSeries(w[c('RecordA0',"RecordA1")])
ws<-scale(wts,center=-200,scale=400)

jefferis/gphys documentation built on June 18, 2024, 4:35 a.m.