skipgram_freq {eHDPrep}R Documentation

Report Skipgram Frequency


Measures the frequency of skipgrams (non-contiguous words in free text), reported in a tibble. Frequency is reported as both counts and percentages.


skipgram_freq(skipgram_tokens, min_freq = 1)



Output of skipgram_identify.


Minimum skipgram percentage frequency of occurrence to retain. Default = 1.


Data frame containing frequency of skipgrams in absolute count and relative to the length of input variable.


Guthrie, D., Allison, B., Liu, W., Guthrie, L. & Wilks, Y. A Closer Look at Skip-gram Modelling. in Proceedings of the Fifth International Conference on Language Resources and Evaluation (LREC’06) (European Language Resources Association (ELRA), 2006).

Benoit K, Watanabe K, Wang H, Nulty P, Obeng A, Müller S, Matsuo A (2018). “quanteda: An R package for the quantitative analysis of textual data.” _Journal of Open Source Software_, *3*(30), 774. doi:10.21105/joss.00774 <>, <>.

Feinerer I, Hornik K (2020). _tm: Text Mining Package_. R package version 0.7-8, <>.

Ingo Feinerer, Kurt Hornik, and David Meyer (2008). Text Mining Infrastructure in R. Journal of Statistical Software 25(5): 1-54. URL:

See Also

Principle underlying function: tokens_ngrams

Other free text functions: extract_freetext(), skipgram_append(), skipgram_identify()


toks_m <- skipgram_identify(x = example_data$free_text,
                            ids = example_data$patient_id,
                            max_interrupt_words = 5)
skipgram_freq(toks_m, min_freq = 0.5)

[Package eHDPrep version 1.2.1 Index]