Skip to contents

Count each POS type for different groups of participants. Data is split based on different values in the `field` column of formatted data. Results will be shown within the plots pane.

Usage

fst_pos_compare(data, field, exclude_nulls = FALSE, rename_nulls = "null_data")

Arguments

data

A dataframe of text in CoNLL-U format with additional `field` column for splitting data.

field

Column in `data` used for splitting groups

exclude_nulls

Whether to include NULLs in `field` column, default is `FALSE`

rename_nulls

What to fill NULL values with if `exclude_nulls = FALSE`.

Value

Table of POS tag counts for the groups.

Examples

fst_pos_compare(fst_child, 'gender')
#>     UPOS        Part_of_Speech_Name boy-Count boy-Prop girl-Count girl-Prop
#> 1    ADJ                  adjective        61    0.085         95     0.111
#> 2    ADP                 adposition         2    0.003          3     0.003
#> 3    ADV                     adverb        48    0.067         50     0.058
#> 4    AUX                  auxiliary        22    0.031         14     0.016
#> 5  CCONJ   coordinating conjunction         1    0.001          0     0.000
#> 6    DET                 determiner        30    0.042         42     0.049
#> 7   INTJ               interjection        11    0.015          5     0.006
#> 8   NOUN                       noun       204    0.283        251     0.292
#> 9    NUM                    numeral         0    0.000          2     0.002
#> 10  PART                   particle        16    0.022         22     0.026
#> 11  PRON                    pronoun        66    0.092         82     0.095
#> 12 PROPN                proper noun         4    0.006          2     0.002
#> 13 PUNCT                punctuation         0    0.000          0     0.000
#> 14 SCONJ  subordinating conjunction         0    0.000          0     0.000
#> 15   SYM                     symbol         0    0.000          0     0.000
#> 16  VERB                       verb       254    0.352        291     0.339
#> 17     X                      other         2    0.003          0     0.000
fst_pos_compare(fst_dev_coop, 'region')
#>     UPOS        Part_of_Speech_Name Etelä-Suomi-Count Etelä-Suomi-Prop
#> 1    ADJ                  adjective                79            0.101
#> 2    ADP                 adposition                 4            0.005
#> 3    ADV                     adverb                 8            0.010
#> 4    AUX                  auxiliary                 1            0.001
#> 5  CCONJ   coordinating conjunction                 1            0.001
#> 6    DET                 determiner                 6            0.008
#> 7   INTJ               interjection                 0            0.000
#> 8   NOUN                       noun               610            0.776
#> 9    NUM                    numeral                 1            0.001
#> 10  PART                   particle                 2            0.003
#> 11  PRON                    pronoun                 1            0.001
#> 12 PROPN                proper noun                 3            0.004
#> 13 PUNCT                punctuation                 0            0.000
#> 14 SCONJ  subordinating conjunction                 0            0.000
#> 15   SYM                     symbol                 0            0.000
#> 16  VERB                       verb                69            0.088
#> 17     X                      other                 1            0.001
#>    Helsinki-Uusimaa-Count Helsinki-Uusimaa-Prop Länsi-Suomi-Count
#> 1                     118                 0.098               105
#> 2                      11                 0.009                 6
#> 3                      20                 0.017                22
#> 4                       1                 0.001                 1
#> 5                       0                 0.000                 1
#> 6                      10                 0.008                 7
#> 7                       2                 0.002                 0
#> 8                     936                 0.774              1028
#> 9                       1                 0.001                 3
#> 10                     15                 0.012                 9
#> 11                      4                 0.003                 3
#> 12                     12                 0.010                14
#> 13                      0                 0.000                 0
#> 14                      0                 0.000                 0
#> 15                      1                 0.001                 0
#> 16                     72                 0.060                75
#> 17                      6                 0.005                 3
#>    Länsi-Suomi-Prop Pohjois- ja Itä-Suomi-Count Pohjois- ja Itä-Suomi-Prop
#> 1             0.082                          84                      0.093
#> 2             0.005                           3                      0.003
#> 3             0.017                          13                      0.014
#> 4             0.001                           0                      0.000
#> 5             0.001                           1                      0.001
#> 6             0.005                           5                      0.006
#> 7             0.000                           0                      0.000
#> 8             0.805                         725                      0.802
#> 9             0.002                           0                      0.000
#> 10            0.007                           3                      0.003
#> 11            0.002                           4                      0.004
#> 12            0.011                           2                      0.002
#> 13            0.000                           0                      0.000
#> 14            0.000                           0                      0.000
#> 15            0.000                           0                      0.000
#> 16            0.059                          62                      0.069
#> 17            0.002                           2                      0.002
#>    null_data-Count null_data-Prop
#> 1                3          0.188
#> 2                0          0.000
#> 3                1          0.062
#> 4                0          0.000
#> 5                0          0.000
#> 6                0          0.000
#> 7                0          0.000
#> 8               12          0.750
#> 9                0          0.000
#> 10               0          0.000
#> 11               0          0.000
#> 12               0          0.000
#> 13               0          0.000
#> 14               0          0.000
#> 15               0          0.000
#> 16               0          0.000
#> 17               0          0.000