get_indices: Get indices of object elements.

Description Usage Arguments Value

View source: R/internal.R

Description

Get the indices of x, as constrained by the requested parameter. If using this function without requested constraints, consider using the faster primitive R function seq_along instead.

Usage

1
get_indices(x, requested = NULL, strict = FALSE)

Arguments

x

An object with elements that are accessible by an index.

requested

A character vector of names, a logical vector of the same length as x, or a numeric vector containing indices of x. If this parameter is not specified, all indices are returned.

strict

Option indicating that requested, if specified, must request indices that are unique and in the same order as the corresponding elements of x.

Value

Integer vector containing indices of x.


gact/utl documentation built on June 1, 2021, 4:24 p.m.