R: Take a number of elements

list.take {rlist} | R Documentation

## 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

    x <- list(a=1,b=2,c=3)
    list.take(x,1)
    list.take(x,10)

[Package rlist version 0.4.6.1 Index]