n_most_frequent_terms: Select 'n' most prevalent terms in 'term_sets'

View source: R/graphs.R

n_most_frequent_termsR Documentation

Select n most prevalent terms in term_sets

Description

Selects n most prevalent terms in set of term sets/annotations including implicit terms. If more than one term are tied at the nth position, all terms are included in the result.

Usage

n_most_frequent_terms(
  ontology,
  term_sets,
  n,
  terms = unique(unlist(term_sets))
)

Arguments

ontology

ontology_index object

term_sets

List of character vectors of ontological term IDs

n

Integer

terms

Character vector of ontological terms

Value

Character vector of length at most n

See Also

remove_terms_with_less_than_n_occurrences

Examples

library(ontologyIndex)
data(hpo)
n_most_frequent_terms(hpo, c("HP:0001873"), 
list(term_sets=list("HP:0001873", "HP:0001902")), n=2)

ontologyPlot documentation built on May 29, 2024, 3:10 a.m.