Description Usage Arguments Value Author(s) Examples
View source: R/count-words-in-a-string.R
This function count the number of words in given string by removing or without special punctuation characters.
1 | count_words_in_string(string, pattern = "[ ]", remove_punctuation = FALSE)
|
string |
A text or paragraph |
pattern |
A pattern to split the given string with |
remove_punctuation |
A boolean argument whether to remove punctuation characters |
Numeric vector of words with their counts of occurrence in passed string
Som Bohora
1 2 | string = "This is a string. This is a a word. hora?"
count_words_in_string(string = string, pattern = "[ ]", remove_punctuation = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.