str_count {x.ent}R Documentation

Count words in a text

Description

Count words of characters in the string which satisfy a regular expression

Usage

  str_count(x, pattern, sep)

Arguments

x

input string

pattern

regular expression

sep

a string used to separate columns, default is "".

Value

number

return a number of words that satisfies a regular expression

Examples

  x = "file_1:b:$:carbonate:c:dimethylsulfide:coccoliths:co2:aragonite:calcite:"
  str_count(x,pattern=":co2:",sep="")

[Package x.ent version 1.1.7 Index]