speech_word_count: Number of words

Description Usage Arguments Value Examples

View source: R/speech_word_count.R

Description

Word count.

Usage

1
2
3
4
5
6
7
8
9
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
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)

Nicolas-Schmidt/speechJava documentation built on Dec. 17, 2021, 5:24 a.m.