R/strx.R

#' Structure with Like
#' 
#' Runs str function but only for names matching a character value (regex).
#' Author: Scott Sobel. Tech Review: Bryce Chamberlain.
#'
#' @param df Object with names you'd like to search.
#' @param char Regex (character value) to match.
#' @param ignore.case (Optional) Ignore case when matching.
#' @export
#'
#' @examples
#' strx(iris,'length')
strx <- function (df, char, ignore.case=T) { 
  utils::str( df[, names(df) %in% namesx( df, char,ignore.case ) ] )
}

Try the easyr package in your browser

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

easyr documentation built on March 31, 2023, 6:22 p.m.