When I apply the tidy function to the result of the LDA model in my dataset, I get the following error "Error in eval(substitute(expr), envir, enclos) : binding not found: 'Var1'". I get the same error when used on associated press example, as shown below. I tried reinstalling the tidytext via devtools::install_github("juliasilge/tidytext") and I still get the same result. Is there something else I can try?
library(tidyr) library(tidytext) library(tidyverse) library(topicmodels) library(Broom)
data("AssociatedPress") AssociatedPress
ap_lda <- LDA(AssociatedPress, k = 2, control = list(seed = 1234)) ap_lda
ap_topics <- tidy(ap_lda, matrix = "beta") ap_topics
<> Non-/sparse entries: 302031/23220327 Sparsity : 99% Maximal term length: 18 Weighting : term frequency (tf)
ap_lda <- LDA(AssociatedPress, k = 2, control = list(seed = 1234)) ap_lda A LDA_VEM topic model with 2 topics.
ap_topics <- tidy(ap_lda, matrix = "beta") Error in eval(substitute(expr), envir, enclos) : binding not found: 'Var1' ap_topics