TSTRIM {bimets} | R Documentation |
Trim a Time Series
Description
This function removes trailing or leading missing values NA
from the input array or the input time series. Users can provide the value to be removed other than NA
missing value by using the argument VALUE
.
Usage
TSTRIM(x=NULL, VALUE=NA, TRAIL=TRUE, LEAD=TRUE, avoidCompliance=FALSE, ...)
Arguments
x |
Input numerical array or time series that must satisfy the compliance control check defined in |
VALUE |
Target value to be removed. Default to missing value |
TRAIL |
If |
LEAD |
If |
avoidCompliance |
If |
... |
Backward compatibility. |
Value
This function returns an object of the same class of the input, i.e. an array or a BIMETS time series, built by removing leading and trailing user-defined values.
See Also
TSLAG
TSJOIN
TSMERGE
TSPROJECT
CUMSUM
INDEXNUM
Examples
#TS A
n<-10
ts1<-TSERIES(c(NA,1:n,NA),START=c(2000,1),FREQ='A')
TABIT(ts1,TSTRIM(ts1))
ts1<-TSERIES(c(NA,1:n,NA),START=c(2000,1),FREQ='A')
TABIT(ts1,TSTRIM(ts1,TRAIL=FALSE))
ts1<-TSERIES(c(NA,1:n,NA),START=c(2000,1),FREQ='A')
TABIT(ts1,TSTRIM(ts1,LEAD=FALSE))
ts1<-TSERIES(c(0,0,NA,1:n,NA,0),START=c(2000,1),FREQ='A')
TABIT(ts1,TSTRIM(ts1,0))