Get inverse document frequencies of values in one vector x
categorized by another vector by
.
Source: R/skills_ramp.R
get_idf_by.Rd
Get inverse document frequencies of values in one vector x
categorized by another vector by
.
See also
Other vectorized functions:
get_cumulative_vocabulary()
,
get_frequency()
,
get_hir()
,
get_htr()
,
get_match()
,
get_sentiment()
,
get_tf_by()
,
get_tfidf_by()
,
get_ttr()
,
is_hapax()
,
is_new()
Examples
my_values <- c(
"the", "cat", "was", "bad",
"the", "dog", "was", "very", "good",
"the", "lizard", "is", "the", "most", "bad")
my_docs <- c(
"A", "A", "A", "A",
"B", "B", "B", "B", "B",
"C", "C", "C", "C", "C", "C")
get_idf_by(my_values, my_docs)
#> [1] 0.0000000 1.0986123 0.4054651 0.4054651 0.0000000 1.0986123 0.4054651
#> [8] 1.0986123 1.0986123 0.0000000 1.0986123 1.0986123 0.0000000 1.0986123
#> [15] 0.4054651