count_words_in_string: This function count the number of words in given string

Description Usage Arguments Value Author(s) Examples

View source: R/count-words-in-a-string.R

Description

This function count the number of words in given string by removing or without special punctuation characters.

Usage

1
count_words_in_string(string, pattern = "[ ]", remove_punctuation = FALSE)

Arguments

string

A text or paragraph

pattern

A pattern to split the given string with

remove_punctuation

A boolean argument whether to remove punctuation characters

Value

Numeric vector of words with their counts of occurrence in passed string

Author(s)

Som Bohora

Examples

1
2
string = "This is a string. This is a a word. hora?"
count_words_in_string(string = string, pattern = "[ ]", remove_punctuation = TRUE)

sbohora/Somya documentation built on May 14, 2019, 7:35 a.m.