bracket: Subsets a data using bracket notation

View source: R/bracket.r

bracketR Documentation

Subsets a data using bracket notation

Description

A wrapper function for bracket notation. The function only allows one index; for two-dimensional objects, the index is used on the columns.

Usage

bracket(data_object, index)

Arguments

data_object

a data object

index

a character, logical, or numeric vector

Value

a subset of the data

Examples

# load package
data(nhanes)

# look at the first few values of dmdborn4
nhanes |> bracket('dmdborn4') |> head()

baseverse documentation built on April 29, 2026, 1:08 a.m.