word_frequency: word_frequency

Description Usage Arguments Value Examples

View source: R/word_frequency.R

Description

A function to count occurences in a set of strings; function does minimal cleaning (remove punctuation and extra spaces);

Usage

1

Arguments

string

character vector

Value

data frame with word frequency

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# with simple vector
names = c("company name 1", "company name 2", "company 3")
word_frequency(names)

# with a dataframe
col1 = c(1,2,3)
df1 = cbind(col1, names)
word_frequency(df1[,2])

# more complicated example
names = c("company name 1", "company &    3 inc.", "co nm 1,, lp")
df2 = cbind(col1, names)
word_frequency(df2[,2])

mfriedri12/fedmatch documentation built on Aug. 4, 2017, 7:41 a.m.