| search_rows {fritools} | R Documentation |
Search All Rows Across Columns of a Matrix-like Structure
Description
I sometimes need to see which rows of a matrix-like structure
contain a string matched by a search pattern.
This somewhat similar to writing a matrix-like structure to disk and then
using search_files on it.
Usage
search_rows(x, pattern = ".*", include_row_names = TRUE)
Arguments
x |
A |
pattern |
A pattern. |
include_row_names |
Include row names into the search? |
Value
All rows where the pattern was found in at least one column.
See Also
Other searching functions:
compare_vectors(),
file_modified_last(),
find_files(),
fromto(),
grep_file(),
missing_docs,
search_files(),
summary.filesearch()
Examples
p <- "\\<4.0[[:alpha:]]*\\>"
search_rows(x = mtcars, pattern = p)
search_rows(x = mtcars, pattern = p, include_row_names = FALSE)
try(search_rows(x = mtcars, pattern = "ABC"))
[Package fritools version 4.3.0 Index]