2.3.2.conditioning.pems.data {pems.utils}R Documentation

Data conditioning for pems data

Description

Various functions for the conditioning of pems objects.

Usage


cutBy(ref = NULL, ..., data = NULL, cut.method = NULL, 
        labels = NULL, fun.name = "cutBy")

cutByRow(ref = NULL, n = 4, rows = NULL, ..., data = NULL,  
        fun.name = "cutByRow")

Arguments

ref

(Data series typically vector) The reference data series to consider when making a vector of subset markers/indices. See Details.

...

(Optional) Other arguments, currently passed on to pems.utils management functions.

data

(Optional data.frame or pems object) The data source if ref is supplied in either a data.frame or pems object.

cut.method

(Optional function) For cutBy only, the method to use when cutting ref. If not supplied, cutByRow used by default.

labels

(Character vector) For cutBy only, a vector of names to be assigned to the cut regions.

fun.name

(function managment argument) fun.name is the name of the parent function, to be used in error messaging.

n, rows

(numerics) n sets the number of equal intervals to attempt to cut the data into. rows sets the exact rows at which to cut the data at. If n is applied and the length of ref is not exactly divisible by n a best attempt is made. If both n and rows are set, rows is applied.

Details

cutBy and cutBy... functions generate a vector of subset markers or indices based of the type of cut applied and the range/size of the reference, ref. See Value regarding outputs.

cutBy is a wrapper for other cutBy... functions. It provides additional options for cut.marker naming.

cutByRow assigns cut regions based in row number.

Value

By default results are returned as pems.elements.

The cut.marker vector generated by cutBY and cutBy... functions can then be used to condition and subsample data in pems objects.

Warning

Currently, no warnings.

Note

Various other cutBy... options can be very simply encoded.

Author(s)

Karl Ropkins

References

References in preparation.

See Also

cut, etc. in the main R package.

Examples


###########
##example 1 
###########

#basic usage

#working with a temporary pems

temp <- pems.1

#cut into equal subsets

temp$ref <- cutBy(velocity, n= 5, data=temp)

pemsPlot(local.time, velocity, cond=ref, data=temp, 
             type="l", layout=c(1,5))

#cut at three points

temp <- pems.1
temp$ref <- cutBy(velocity, rows=c(180,410,700), data=temp)

pemsPlot(local.time, velocity, cond=ref, data=temp, 
             type="l", layout=c(1,5))


[Package pems.utils version 0.2.27.4 Index]