refine_keywords: Refine keywords

refine_keywordsR Documentation

Refine keywords

Description

Refine keywords by (1) dropping keywords that do not appear in the documents and (2) dropping topics that does not have any occurence in the documents.

Usage

refine_keywords(keywords, docs, prune = TRUE)

Arguments

keywords

a list of keywords

docs

a keyATM_docs object, generated by keyATM_read() function

prune

logical, whether to prune keywords that do not appear in the documents

Value

a list of refined keywords

Examples

## Not run: 
  library(quanteda)
  data(keyATM_data_bills)
  bills_keywords <- keyATM_data_bills$keywords
  bills_dfm <- keyATM_data_bills$doc_dfm  # quanteda dfm object
  keyATM_docs <- keyATM_read(bills_dfm)
  bills_keywords$Videogame <- c("metroid", "castlevania", "balatro")
  refine_keywords(bills_keywords, keyATM_docs)

## End(Not run)

keyATM documentation built on Jan. 18, 2026, 1:07 a.m.