first {quantmod}R Documentation

Return First or Last Element of Data

Description

A simple generic function to return the first or last element or row of a vector or two-dimensional data object.

Usage

first(x,...)
last(x,...)

## Default S3 method:
first(x,...)

## Default S3 method:
last(x,...)

Arguments

x 1 or 2 dimensional data object
... additional args - unused

Details

A simple wrapper to extract the first or last element of an object.

Value

A one element/row data object

Author(s)

Jeffrey A. Ryan

Examples

first(1:100)
last(1:100)

data(LakeHuron)
first(LakeHuron)
last(LakeHuron)

[Package quantmod version 0.2-5 Index]