speech_word_count {speech}R Documentation

Number of words

Description

Word count.

Usage

speech_word_count(
  string,
  rm.name = FALSE,
  exclude = NULL,
  min.char = 0L,
  rm.long = Inf,
  rm.num = FALSE,
  replace.punct = ""
)

Arguments

string

character of length equal to or greater than one.

rm.name

by default is FALSE. Remove word 'SENOR' and name of legislator.

exclude

words that are to be excluded from counting.

min.char

integer that determines the words that have less than a certain number of characters.

rm.long

integer that determines the number of characters from which words have to be deleted from the count.

rm.num

logical. Indicates whether the numbers in the count will be eliminated.

replace.punct

by default is "".

Value

integer.

Examples

vec <- "Hello world!"
speech_word_count(vec)

vec2 <- "Hello.world!"
speech_word_count(vec2)
speech_word_count(vec2, replace.punct = " ")

vec3 <- "Hello.world!, HelloHelloHelloHelloHelloHello"
speech_word_count(vec3, replace.punct = " ", rm.long = 20)

speech_word_count("R version", min.char = 1)

r <- "R version 3.5.2 (2018-12-20) -- 'Eggshell Igloo'"
speech_word_count(r, rm.num = TRUE)

speech_word_count(NA)


# 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)


[Package speech version 0.1.5 Index]