freqlist_leipzig_summarise: Summarise wordlist count across corpus

Description Usage Arguments Value Examples

View source: R/corplingr_freqlist_leipzig_summarise.R

Description

function to summarise the wordlist by removing the corpus variable derived via freqlist_leipzig_each or freqlist_leipzig_all.

Usage

1
freqlist_leipzig_summarise(df, group_var = NULL, descending = TRUE)

Arguments

df

a tibble data frame containing wordlist derived via the freqlist_leipzig_each or freqlist_leipzig_all.

group_var

a bare (i.e. unquoted) variable name to group by.

descending

whether the data is ordered in decreasing order according to the token frequency (TRUE – the default) or in ascending order (FALSE).

Value

a tibble

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
regex <- "\\bmemberi(kan)?\\b"
corpus.path <- corpus_files_path[1:2]

# Generate the freqlist of the pattern
wlist <- freqlist_create(pattern = regex,
                         corpus_file_names = corpus.path,
                         case_insensitive = TRUE)

wlist
A tibble: 4 x 3
match      corpus_id              n
<chr>      <chr>              <int>
 1 memberi    ind_mixed_2012_1M   6394
 2 memberikan ind_mixed_2012_1M  11710
 3 memberi    ind_news_2008_300K  2214
 4 memberikan ind_news_2008_300K  5213

# Summarise the match
freqlist_summarise(df = wlist, group_var = match, descending = TRUE)

## End(Not run)

gederajeg/corplingr documentation built on Dec. 20, 2021, 9:50 a.m.