col_search_sum: Count the number of times each column in a data frame matches...

View source: R/global_search.R

col_search_sumR Documentation

Count the number of times each column in a data frame matches a pattern.

Description

Search every character column of a data frame for a pattern and count hits.

Usage

col_search_sum(df, pattern, na.rm = TRUE)

Arguments

df

A data frame

pattern

The pattern to search for (regular expression)

na.rm

Ignore missing values.

Value

A data frame where each column is the number of times that column matched the target pattern.


jonathan-g/semestr documentation built on Jan. 23, 2025, 3:10 p.m.