create_term_document_matrix: Create a term-document matrix from preprocessed text

View source: R/text_preprocessing.R

create_term_document_matrixR Documentation

Create a term-document matrix from preprocessed text

Description

This function creates a term-document matrix from preprocessed text data. It's a simplified version of create_tdm() for direct use in models.

Usage

create_term_document_matrix(preprocessed_data, min_df = 2, max_df = 0.9)

Arguments

preprocessed_data

A data frame with preprocessed text data.

min_df

Minimum document frequency for a term to be included.

max_df

Maximum document frequency (as a proportion) for a term to be included.

Value

A term-document matrix.


LBDiscover documentation built on June 16, 2025, 5:09 p.m.