Skip to contents

This function merges information from two frequency lists, subtracting the frequencies found in the second frequency lists from the frequencies found in the first list.

Usage

freqlist_diff(x, y)

Arguments

x, y

Objects of class freqlist.

Value

An object of class freqlist.

Examples

(flist1 <- freqlist("A first toy corpus.", as_text = TRUE))
#> Frequency list (types in list: 4, tokens in list: 4)
#> rank   type abs_freq nrm_freq
#> ---- ------ -------- --------
#>    1      a        1     2500
#>    2 corpus        1     2500
#>    3  first        1     2500
#>    4    toy        1     2500
(flist2 <- freqlist("A second toy corpus.", as_text = TRUE))
#> Frequency list (types in list: 4, tokens in list: 4)
#> rank   type abs_freq nrm_freq
#> ---- ------ -------- --------
#>    1      a        1     2500
#>    2 corpus        1     2500
#>    3 second        1     2500
#>    4    toy        1     2500

freqlist_diff(flist1, flist2)
#> Frequency list (types in list: 5, tokens in list: 1)
#> <total number of tokens: 0>
#> rank   type abs_freq
#> ---- ------ --------
#>    1  first        1
#>    2      a        0
#>    3 corpus        0
#>    4 second        0
#>    5    toy        0