Gets C length of a vector ignoring any length-methods dispatched by classes

get_length(x)

Arguments

x

a vector

Value

integer scalar

Details

Queries the vector length using C-macro LENGTH, this can be substantially faster than length(unclass(x))

Examples

length(bit(12))
#> [1] 12
get_length(bit(12))
#> [1] 1