Skip to content

Commit

Permalink
remove count when removed = 0
Browse files Browse the repository at this point in the history
  • Loading branch information
cristinamullin committed Dec 7, 2023
1 parent 3765850 commit 6d88581
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/mod_review_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ mod_review_data_server <- function(id, tadat) {
if (nrow(rem_reas) > 0) {
review_things$rem_reas <- rem_reas
} else{
review_things$rem_reas <- data.frame(Reason="No Removals", Count=1)
review_things$rem_reas <- data.frame(Reason = "No Removals", Count = 1)
}
})

Expand Down Expand Up @@ -125,7 +125,11 @@ mod_review_data_server <- function(id, tadat) {
output$reason_pie <- shiny::renderPlot({
shiny::req(review_things$rem_reas)
dat <- review_things$rem_reas
dat$Legend <- paste0(dat$Reason, " - ", dat$Count, " results")
if (nrow(review_things$rem_reas) > 1) {
dat$Legend <- paste0(dat$Reason, " - ", dat$Count, " results")
} else{
dat$Legend <- paste0(dat$Reason)
}
dat <- dat %>%
dplyr::rowwise() %>%
dplyr::mutate(Legend = TADA::TADA_InsertBreaks(Legend, len = 100))
Expand Down

0 comments on commit 6d88581

Please sign in to comment.