Converts various time series to an object of class \tt signalSeries.
USAGE:
as.signalSeries(data, position = list( from = 1, by = 1, units = ""),
from = NULL, by = NULL, to = NULL, length.out = NULL,
units = "", title.data = "", documentation = "")
DESCRIPTION:
Converts numeric data to an object of class signalSeries containing one
dimensional data. The input data is assumed to be uniformly sampled.
REQUIRED ARGUMENTS:
data
A numeric vector, matrix or an object of class ts (uniform sampling assumed). If
a matrix, the longest first row or column is extracted.
OPTIONAL ARGUMENTS:
position
A list containing the arguments from, by and to which describe the position(s)
of the input data. All position arguments need not be specified as missing
members will be filled in by their default values. Default: list(from = 1, by =
1, units = NULL).
from
A list containing the arguments from, by and to which describe the position(s)
of the input data. All position arguments need not be specified as missing
members will be filled in by their default values. Default: NULL.
to
A numeric containing the end point in data from which the values should be
extracted. This parameter must coordinate with the position arguments and can be
used in combination with the by and to arguments. The length.out argument should
not be specified if both the from and to arguments are specified. Default: NULL.
by
a numeric containing the sampling rate at which the values in data should be
extracted. This parameter must coordinate with the position arguments and can be
used in combination with the by, to, or length.out arguments. This argument is
not the same as the position$by argument which denotes the sampling rate of the
original data. Default: NULL.
length.out
an integer containing the maximum number of values to extract from data. Because
data is a finite length sequence, the actual number of values returned may be
less than that specified by this argument depending upon the conditions imposed
by the from and by arguments. The length.out argument should not be specified if
both the from and to arguments are specified. Default: NULL.
title.data
a string representing the name of the input data. Default: NULL.
documentation
a string used to describe the input data. Default: NULL.
units
A string denoting the units of the time series. Default: empty string.
na.rm
A logical flag used to indicate if NaN values should be removed from the input.
Default: TRUE.
VALUE:
result
an object of class signalSeries.
SEE ALSO:
.
EXAMPLES:
## convert an explicitly developed numeric vector
x <- 1:10
as.signalSeries( x )
## now impose hypothetical positions on the data
as.signalSeries( x, pos=list(from = 0.3, by = 0.1) )
## extract the values from position 0.5 onward
as.signalSeries( x, pos=list(from = 0.3, by = 0.1),
+ from = 0.5 )
## extract the values from position 0.5 onward, but
## keep only the first 3 values of the extraction
as.signalSeries( x, pos=list(from = 0.3, by = 0.1),
+ from = 0.5, length = 3 )
## extract the values from position 0.5 onward
## and skip every other point (sample the data
## at 0.2 position intervals)
as.signalSeries( x, pos=list(from = 0.3, by = 0.1),
+ from = 0.5, by = 0.2 )
## simply return the first 4 values, and supply a title and
## some documentation comments to the data
as.signalSeries( x, length = 4, title = "Faux Data",
+ doc = "An example" )