Returns the first non-NULL DFM from a priority fallback chain.
Useful when multiple DFM processing stages exist and you need the most processed available version.
Usage
get_available_dfm(
dfm_lemma = NULL,
dfm_outcome = NULL,
dfm_final = NULL,
dfm_init = NULL
)
Arguments
- dfm_lemma
Optional lemmatized DFM (highest priority)
- dfm_outcome
Optional preprocessed DFM (medium priority)
- dfm_final
Optional final processed DFM (medium-low priority)
- dfm_init
Optional initial DFM (lowest priority)
Value
The first non-NULL DFM from the priority chain, or NULL if all are NULL
Details
Priority order (highest to lowest):
dfm_lemma - Lemmatized tokens (most processed)
dfm_outcome - Preprocessed tokens
dfm_final - Final processed version
dfm_init - Initial unprocessed tokens
Examples
if (FALSE) { # \dontrun{
dfm1 <- quanteda::dfm(quanteda::tokens("assistive technology supports learning"))
result <- get_available_dfm(dfm_init = dfm1)
} # }