dropFirst function

Drop the first element of a vector or matrix

Drop the first element of a vector or matrix

A utility function, dropFirst drops the first element of a vector or matrix, retaining the correct time series attributes, in case the argument is a time series object.

dropFirst(x)

Arguments

  • x: a vector or matrix.

Returns

The function returns x[-1] or x[-1,], if the argument is a matrix. For an argument of class ts the class is preserved, together with the correct tsp attribute.

Author(s)

Giovanni Petris GPetris@uark.edu

Examples

(pres <- dropFirst(presidents)) start(presidents) start(pres)
  • Maintainer: Giovanni Petris
  • License: GPL (>= 2)
  • Last published: 2024-09-21

Useful links