Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dropFirst

Drop the first element of a vector or matrix


Description

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.

Usage

dropFirst(x)

Arguments

x

a vector or matrix.

Value

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)

dlm

Bayesian and Likelihood Analysis of Dynamic Linear Models

v1.1-5
GPL (>= 2)
Authors
Giovanni Petris [aut, cre], Wally Gilks [ctb] (Author of original C code for ARMS)
Initial release
2018-05-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.