search_list: Searches a list of dataframes.

View source: R/search_list.R

search_listR Documentation

Searches a list of dataframes.

Description

Takes a list of dataframes and searches their variables for either a specific variable name or for a string within the variable names.

Usage

search_list(ls, string, exact = TRUE, ignore.case = FALSE)

Arguments

ls

A list of dataframes

string

A string, either the exact variable name or something to search for.

exact

Logical. If exact = TRUE then search_list finds the exact variable, if exact = FALSE then search_list finds all variable names containing that string using stringr::str_detect().

ignore.case

Logical. Determines whether to ignore case when exact = FALSE.

Value

A data.frame

Examples

files <- list(mtcars = mtcars, iris = iris)
search_list(files, "Sepal", exact = FALSE)
search_list(files, "hp")


EstherHerbert/Useful.functions documentation built on Jan. 31, 2025, 10:41 a.m.