Word count.
speech_word_count(
string,
rm.name = FALSE,
exclude = NULL,
min.char = 0L,
rm.long = Inf,
rm.num = FALSE,
replace.punct = ""
)
character of length equal to or greater than one.
by default is FALSE
. Remove word 'SENOR' and name of legislator.
words that are to be excluded from counting.
integer that determines the words that have less than a certain number of characters.
integer that determines the number of characters from which words have to be deleted from the count.
logical. Indicates whether the numbers in the count will be eliminated.
by default is "".
integer.
vec <- "Hello world!"
speech_word_count(vec)
#> [1] NA
vec2 <- "Hello.world!"
speech_word_count(vec2)
#> [1] NA
speech_word_count(vec2, replace.punct = " ")
#> [1] NA
vec3 <- "Hello.world!, HelloHelloHelloHelloHelloHello"
speech_word_count(vec3, replace.punct = " ", rm.long = 20)
#> [1] NA
speech_word_count("R version", min.char = 1)
#> [1] NA
r <- "R version 3.5.2 (2018-12-20) -- 'Eggshell Igloo'"
speech_word_count(r, rm.num = TRUE)
#> [1] NA
speech_word_count(NA)
#> [1] NA
# \donttest{
# url <- "http://bit.ly/35AUVF4"
# out <- speech_build(file = url, compiler = TRUE)
# out$word <- speech_word_count(out$speech, rm.name = TRUE)
# out$word2 <- speech_word_count(out$speech)
# }