rlist (version 0.4.6.1)

list.take: Take a number of elements

Description

Take the first n elements out from a list or vector.

Usage

list.take(.data, n, force = FALSE)

Arguments

.data

list or vector

n

integer. The number of elements to take

force

TRUE to disable the length check

See Also

list.takeWhile, list.skip, list.skipWhile

Examples

Run this code
# NOT RUN {
x <- list(a=1,b=2,c=3)
list.take(x,1)
list.take(x,10)
# }

Run the code above in your browser using DataCamp Workspace