first: Get the first element of a vector

Description Usage Arguments Value Author(s) See Also Examples

Description

Extract the first element of a vector. Useful for the turnogram() function

Usage

1
first(x, na.rm=FALSE)

Arguments

x

a numerical vector

na.rm

if na.rm=TRUE, then the first non-missing value (if any) is returned. By default, it is FALSE and the first element (whatever its value) is returned

Value

a numerical value

Author(s)

Philippe Grosjean (phgrosjean@sciviews.org), Frédéric Ibanez (ibanez@obs-vlfr.fr)

See Also

last, turnogram

Examples

1
2
3
a <- c(NA, 1, 2, NA, 3, 4, NA)
first(a)
first(a, na.rm=TRUE)

pastecs documentation built on May 2, 2019, 3:36 p.m.

Related to first in pastecs...