Skip to content

first(named_vector) removes names #2487

@franknarf1

Description

@franknarf1
library(data.table)
x = setNames(, "A")
x[1]
#>   A 
#> "A"
first(x)
#> [1] "A"

In example(first), it suggests first(x) and x[1] should be interchangeable, but it doesn't hold here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions