Skip to content

Return the element at the given index

Source code

Description

Return the element at the given index

Usage

<Series>$item(index = NULL)

Arguments

index Index of the item to return.

Value

A value of length 1

Examples

library(polars)

s1 = pl$Series(values = 1)

s1$item()
#> [1] 1
s2 = pl$Series(values = 9:7)

s2$cum_sum()$item(-1)
#> [1] 24