Learn R Programming

keyATM (version 0.5.5)

refine_keywords: 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)

Value

a list of refined keywords

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

Examples

Run this code
if (FALSE) {
  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)
}

Run the code above in your browser using DataLab