car: Return first element of vector

View source: R/split-map-filter-reduce.R

carR Documentation

Return first element of vector

Description

Takes a vector and returns the first element Equivalent to Lisp's car function

Usage

car(x)

Arguments

x

A vector

Details

Originally for use as a reduction function in split_map_filter_reduce

Value

Returns first element of vector

See Also

split_map_filter_reduce

Examples

car(c(8, 6, 7, 5, 3, 0, 9))      # 8
mt <- as.data.table(mtcars)
dt_del_cols(mt, "cyl", "disp", "hp")


libbib documentation built on Nov. 10, 2022, 6:16 p.m.