inst/code/compile_newsgroups_results_for_annotation.R

# I run this after compute_newsgroups_topics.R to compile the key
# matrices I would like to keep for subsequent analyses.
library(tools)
library(fastTopics)

# Load the newsgroups data.
load("../data/newsgroups.RData")

# Load the output generated by the compute_newsgroups_topics.R script.
load("../output/newsgroups_topics.RData")

# Get the topic proportions matrix.
L <- poisson2multinom(pnmf)$L

# Get the posterior mean log-fold changes (compared to the mean word
# frequencies), and call this the F matrix. Note that here we are
# using the base-2 logarithm.
F <- de_vsnull$postmean

# Save the compiled results to an .Rdata file.
newsgroups <- list(topics = topics,L = L,F = F)
save(list = "newsgroups",file = "newsgroups.RData")
resaveRdaFiles("newsgroups.RData")
stephenslab/fastTopics documentation built on March 29, 2025, 3:24 p.m.