This is a 'data.table' implementation that mimics the output of
pairwise_count()
from 'widyr' to reduce package dependency. This is used
internally within tm_cooc()
.
Arguments
- data
Data frame output from
tm_clean()
.- id
String to represent the id variable. Defaults to
"line"
.- word
String to represent the word variable. Defaults to
"word"
.
See also
Other Support:
any_idate()
,
camel_clean()
,
check_inputs()
,
cut_hour()
,
extract_date_range()
,
extract_hr()
,
heat_colours()
,
is_date_format()
,
maxmin()
,
read_preamble()
,
rgb2hex()
,
totals_bind()
,
totals_col()
,
tstamp()
,
us_to_space()
,
wrap()
Other Text-mining:
meeting_tm_report()
,
tm_clean()
,
tm_cooc()
,
tm_freq()
,
tm_wordcloud()
Examples
td <- data.frame(line = c(1, 1, 2, 2),
word = c("work", "meeting", "catch", "up"))
pairwise_count(td, id = "line", word = "word")
#> # A tibble: 2 × 3
#> item1 item2 n
#> <chr> <chr> <int>
#> 1 work meeting 1
#> 2 catch up 1