You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error in if (!is.null(texts) && length(texts) != nrow(theta)) stop("Number of provided texts and number of documents modeled do not match") : missing value where TRUE/FALSE needed
#268
Open
michaelGRU opened this issue
Jan 27, 2022
· 0 comments
Hi I keep getting this error when I'm using findThoughts().
df is a data frame that contains text information and user ID.
This is my code
#stemming and stopword removalprocessed<- textProcessor(df$tweet, metadata=df)
#structure and index the data for usage in the structural topic modelout<- prepDocuments(processed$documents, processed$vocab, processed$meta)
#save the output object meta, documents, and vocab into variables:docs<-out$documentsvocab<-out$vocabmeta<-out$metapoliblogPrevFit<- stm(out$documents, out$vocab, K=15, prevalence=~type,
max.em.its=75, data=out$meta, init.type="Spectral",
verbose=FALSE)
thoughts1<- findThoughts(df, texts= as.character(out$meta$tweet), n=1, topics=4)$docs[[1]]
Error in if (!is.null(texts) && length(texts) != nrow(theta)) stop("Number of provided texts and number of documents modeled do not match") :
missing value where TRUE/FALSE needed
It says "Your corpus now has 998 documents, 1761 terms and 14704 tokens."
length(out$meta$tweet) returns 998. The number of provided texts and the number of documents modeled do match, no?
Can give me a hint on what might be the issue?
The text was updated successfully, but these errors were encountered:
Hi I keep getting this error when I'm using findThoughts().
df is a data frame that contains text information and user ID.
This is my code
Error in if (!is.null(texts) && length(texts) != nrow(theta)) stop("Number of provided texts and number of documents modeled do not match") :
missing value where TRUE/FALSE needed
It says "Your corpus now has 998 documents, 1761 terms and 14704 tokens."
length(out$meta$tweet) returns 998. The number of provided texts and the number of documents modeled do match, no?
Can give me a hint on what might be the issue?
The text was updated successfully, but these errors were encountered: