Skip to contents

Count the number of occurrences of a string over a data frame row-wise

Usage

string_count(df, pattern = "", new_colname = "count")

Arguments

df

A dataframe

pattern

A pattern to pass to stringr::str_count(). Default to "".

new_colname

The newly-mutated colname. Default to "count".

Value

A mutated dataframe