tfidf: TF-IDF

View source: R/tfidf.R

tfidfR Documentation

TF-IDF

Description

Run tf-idf on a metadata table.

Usage

tfidf(
  clusts,
  label_var = "dataset",
  cluster_var = "seurat_clusters",
  terms_per_cluster = 1,
  replace_regex = "[.]|[_]|[-]",
  force_new = FALSE,
  with_ties = FALSE
)

Arguments

clusts

data.frame/data.table with the per-cell metadata and cluster assignments.

label_var

Which cell metadata column to input to NLP analysis.

cluster_var

Which cell metadata column to use to identify which cluster each cell is assigned to.

terms_per_cluster

The maximum number of words to return per cluster.

replace_regex

Characters by which to split label_var into terms (i.e. tokens) for NLP enrichment analysis.

force_new

If NLP results are already detected the metadata, set force_new=TRUE to replace them with new results.

with_ties

Should ties be kept together? The default, TRUE, may return more rows than you request. Use FALSE to ignore ties, and return the first n rows.


neurogenomics/scNLP documentation built on Oct. 8, 2024, 5:30 p.m.