R/row_bracket.r

Defines functions row_bracket

Documented in row_bracket

#' Subsets a data using bracket notation
#' 
#' A wrapper function for bracket notation on two-dimensional objects, with bracketing on the rows. 
#'
#' @param data_object a data object
#' @param index a character, logical, or numeric vector
#'
#' @returns a subset of the data
#' @export
#'
#' @examples
#' # load package
#' data(nhanes)
#' 
#' # look at the first few values of dmdborn4
#' nhanes |> row_bracket(1:3)
row_bracket<-function(data_object,index){
  
  data_object[index,]
  
}

Try the baseverse package in your browser

Any scripts or data that you put into this service are public.

baseverse documentation built on Oct. 27, 2026, 1:07 a.m.