1

I was trying my hand at topic modeling for the first time. Tried running the vignette code but getting following errors;

library(pacman)
p_load("tm", "SnowballCC", "RColorBrewer", "ggplot2", "wordcloud", "biclust", 
       "cluster", "igraph", "fpc", "Rcampdf")
p_load("topicmodels", "devtools", "ldatuning")
data("AssociatedPress", package="topicmodels")
dtm <- AssociatedPress[1:10, ]
result <- FindTopicsNumber(
  dtm,
  topics = seq(from = 2, to = 15, by = 1),
  metrics = c("Griffiths2004", "CaoJuan2009", "Arun2010", "Deveaud2014"),
  method = "Gibbs",
  control = list(seed = 77),
  mc.cores = 2L,
  verbose = TRUE
)

knitr::kable(result)
Error in subset.default(values, select = 2:ncol(values)) : 
  argument "subset" is missing, with no default

FindTopicsNumber_plot(result)
Error in seq_len(m) : argument must be coercible to non-negative integer
In addition: Warning messages:
1: In rep(digits, length.out = m) :
  first element used of 'length.out' argument
2: In seq_len(m) : first element used of 'length.out' argument

Need help in resolving the error. Thank you.

4

0 回答 0