Learn R Programming

BERTopic (version 0.1.0)

bertopic_topics_over_time: Compute topics over time

Description

Wrapper for Python BERTopic.topics_over_time(). Returns a tibble and attaches the original Python dataframe in the "_py" attribute for use in visualization.

Usage

bertopic_topics_over_time(
  model,
  docs,
  timestamps,
  nr_bins = NULL,
  datetime_format = NULL
)

Value

A tibble with topics-over-time data; attribute "_py" stores the original Python dataframe.

Arguments

model

A "bertopic_r" model.

docs

Character vector of documents.

timestamps

A vector of timestamps (Date, POSIXt, or character).

nr_bins

Optional number of temporal bins.

datetime_format

Optional strftime-style format if timestamps are strings.