Skip to content

Commit ff6c4ea

Browse files
committed
specify location for function 'posterior'
This is complex because posterior is an S4 method that relies on topicmodels and modeltools (and methods, probably). Unclear which will work yet, so this is a first attempt.
1 parent 23e3a7d commit ff6c4ea

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ Author: Martin J. Westgate <[email protected]>
66
Maintainer: Martin J. Westgate <[email protected]>
77
Description: Tools to support literature review and evidence synthesis in R.
88
Depends: R (>= 3.1.0)
9-
Imports: ade4, plotly, shiny, shinycssloaders, shinydashboard, SnowballC, stringdist, tm, topicmodels, viridisLite, magrittr
9+
Imports: ade4, plotly, shiny, shinycssloaders, shinydashboard, SnowballC, stringdist, tm, topicmodels, viridisLite, magrittr, methods, modeltools
1010
License: GPL-2

NAMESPACE

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ S3method(print, bibliography)
77
S3method(summary, bibliography)
88
S3method(summary, review_info)
99
importFrom(grDevices, grey)
10+
importFrom(magrittr,"%>%")
11+
importFrom(modeltools, posterior)
1012
importFrom(plotly, renderPlotly, event_data)
1113
importFrom(shiny, sliderInput, selectInput, textInput, actionButton, tableOutput, uiOutput, reactiveValues, observeEvent, observe, renderPrint, isolate, fluidRow, strong, column, icon, p)
1214
importFrom(shinydashboard, sidebarMenu, menuItem, menuSubItem)
1315
importFrom(stats, xtabs)
1416
importFrom(tm, removePunctuation, removeWords, removeNumbers, stemDocument, tm_map, Corpus, VectorSource, DocumentTermMatrix, removeSparseTerms, stopwords, content_transformer, weightTf)
17+
importFrom(topicmodels, LDA, CTM)
1518
importFrom(utils, head, tail, write.csv, write.table)
1619
importFrom(viridisLite, magma, viridis, inferno, plasma)
17-
importFrom(magrittr,"%>%")

R/start_review_window.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ if(class(x)=="review_info"){
2525
palette_initial <-viridisLite::magma(n=model@k, alpha=0.9, begin=0, end=0.9)
2626

2727
# data to send to plotinfo
28-
x_matrix<-topicmodels::posterior(model)$topics # article x topic
29-
y_matrix<-t(topicmodels::posterior(model)$terms)
28+
x_matrix<-modeltools::posterior(model)$topics # article x topic
29+
y_matrix<-t(modeltools::posterior(model)$terms)
3030
plot_list<-list(
3131
x=data.frame(
3232
id=rownames(dtm),
@@ -460,8 +460,8 @@ observeEvent(input$go_LDA, {
460460
topic_model=sidebar_tracker$model_type,
461461
n_topics=input$n_topics,
462462
iterations=input$iterations)
463-
x_matrix<-posterior(infostore$model)$topics
464-
y_matrix<-t(posterior(infostore$model)$terms)
463+
x_matrix<-modeltools::posterior(infostore$model)$topics
464+
y_matrix<-t(modeltools::posterior(infostore$model)$terms)
465465
keep_cols<-c("id", "caption", "abstract")
466466
initial_captions<-plotinfo$x[, keep_cols[which(keep_cols %in% colnames(plotinfo$x))]]
467467
# update plotinfo

0 commit comments

Comments
 (0)