compare_convo: Compare vocabularies with set operations

Description Usage Arguments Value Examples

View source: R/compare.R

Description

Compare vocabularies with set operations

Usage

1
compare_convo(vocab1, vocab2, fx = c("setdiff", "intersect", "union"))

Arguments

vocab1

Vocabulary list (or convo object). In the case of validating a new vocabulary against an existing one, this argument should take the new vocabulary.

vocab2

Vocabulary list (or convo object). In the case of validating a new vocabulary against an existing one, this argument should take the existing vocabulary.

fx

Character string describing comparison function. setdiff returns those in vocab1 not in vocab2; intersect returns those in both vocab1 and vocab2; union returns all elements in either

Value

List (of class convomin) of mismatches

Examples

1
2
3
4
5
v1 <- list(letters[1:3], letters[4:6], letters[7:9])
v2 <- list(letters[(1:3)+1], letters[(4:6)-2], letters[7])
compare_convo(v1, v2, "setdiff")
compare_convo(v1, v2, "union")
compare_convo(v1, v2, "intersect")

emilyriederer/convo documentation built on Oct. 5, 2021, 4:08 p.m.