knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

topicl

The goal of topicl is to provide tools for identifying stable (reproducible) topics and for their analysis.

Installation

You can install the development version of topicl from GitHub with:

# install.packages("pak")
pak::pak("paskn/topicl")

Example

See vignette for details.

This is a basic example which shows you how to solve a common problem:

library(topicl)
library(stm)
library(dplyr)

modA <- stm(poliblog5k.docs, 
            poliblog5k.voc, K=25,
            prevalence=~rating, 
            data=poliblog5k.meta,
            max.em.its=2, 
            init.type="Random",
            seed = 9934,
            verbose = F) 

modB <- stm(poliblog5k.docs, 
            poliblog5k.voc, K=25,
            prevalence=~rating, 
            data=poliblog5k.meta,
            max.em.its=2, 
            init.type="Random",
            seed = 9576,
            verbose = F) 

compare_solutions(list(modA, modB), depth=500) |> 
  arrange(desc(jaccard)) |> 
  head()


paskn/topicl documentation built on Feb. 1, 2025, 9:33 p.m.