Skip to content

Commit

Permalink
Bug fixes for screen_topics
Browse files Browse the repository at this point in the history
- show author details no longer generates error
- ngram detection renamed to bigram detection as in make_dtm
  • Loading branch information
mjwestgate committed Dec 17, 2019
1 parent 66c3144 commit dd0213d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions R/format_citation.R
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,17 @@ format_citation.data.frame <- function(
text_list$year <- NA
}
# journal
if(!is.na(a[[source]])){
journal_text <- tools::toTitleCase(tolower(a[[source]]))
if(add_html){
text_list$journal <- paste0("<i>", journal_text, "</i>. ")
if(!is.na(source)){
if(!is.na(a[[source]])){
journal_text <- tools::toTitleCase(tolower(a[[source]]))
if(add_html){
text_list$journal <- paste0("<i>", journal_text, "</i>. ")
}else{
text_list$journal <- paste0(journal_text, ". ")
}
}else{
text_list$journal <- paste0(journal_text, ". ")
text_list$journal <- NA
}
}else{
text_list$journal <- NA
}
# authors
if(any(cols_tr == "author")){
Expand Down
2 changes: 1 addition & 1 deletion R/screen_topics.R
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ server <- function(input, output, session){
stop_words = data$stopwords,
min_freq = input$min_freq * 0.01,
max_freq = input$max_freq * 0.01,
ngram_quantile = input$ngram_quantile * 0.01
bigram_quantile = input$bigram_quantile * 0.01
)

if(input$response_variable != data$columns[1]){
Expand Down
2 changes: 1 addition & 1 deletion R/screen_topics_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ screen_topics_ui <- function(){
value = 85
),
sliderInput(
inputId = "ngram_quantile",
inputId = "bigram_quantile",
label = "Minimum frequency quantile for recognising bigrams (%):",
min = 0,
max = 100,
Expand Down

0 comments on commit dd0213d

Please sign in to comment.