Searches a list of dataframes.
search_list.Rd
Takes a list of dataframes and searches their variables for either a specific variable name or for a string within the variable names.
Arguments
- ls
A list of dataframes
- string
A string, either the exact variable name or something to search for.
- exact
Logical. If
exact = TRUE
thensearch_list
finds the exact variable, ifexact = FALSE
thensearch_list
finds all variable names containing that string usingstringr::str_detect()
.- ignore.case
Logical. Determines whether to ignore case when
exact = FALSE
.
Examples
files <- list(mtcars = mtcars, iris = iris)
search_list(files, "Sepal", exact = FALSE)
#> file variable
#> 1 iris Sepal.Length
#> 2 iris Sepal.Width
search_list(files, "hp")
#> file variable
#> 1 mtcars hp