Skip to content

Commit

Permalink
1.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jinseob2kim committed Dec 7, 2023
1 parent 2ce1425 commit 3beb4c8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: jsmodule
Title: 'RStudio' Addins and 'Shiny' Modules for Medical Research
Version: 1.4.3
Date: 2023-10-18
Version: 1.4.4
Date: 2023-12-07
Authors@R: c(person("Jinseob", "Kim", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-9403-605X")),
person("Zarathu", role = c("cph", "fnd")),
person("Hyunki", "Lee", email = "[email protected]", role = c("aut")),
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ importFrom(data.table,setkey)
importFrom(epiDisplay,tableGlm)
importFrom(geepack,geeglm)
importFrom(ggplot2,ggsave)
importFrom(ggplot2,scale_y_reverse)
importFrom(ggpubr,as_ggplot)
importFrom(ggpubr,ggbarplot)
importFrom(ggpubr,ggboxplot)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# jsmodule 1.4.4

## Update: Add "reverse y-axis" option to lineplot

# jsmodule 1.4.3

## Update `rocModule`: Add accucary/ppv/npv with threshold
Expand Down
12 changes: 10 additions & 2 deletions R/line.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ lineUI <- function(id, label = "lineplot") {
radioButtons(ns("options"), "Option", choices = c("Mean_SE", "Mean_SD", "Median_IQR"), selected = "Mean_SE", inline = T),
checkboxInput(ns("linetype"), "Linetype"),
checkboxInput(ns("jitter"), "Jitter"),
checkboxInput(ns("rev_y"), "Reverse Y-axis"),
uiOutput(ns("subvar")),
uiOutput(ns("subval"))
)
Expand Down Expand Up @@ -96,7 +97,7 @@ lineUI <- function(id, label = "lineplot") {
#' @import shiny
#' @importFrom data.table data.table .SD :=
#' @importFrom ggpubr ggline
#' @importFrom ggplot2 ggsave
#' @importFrom ggplot2 ggsave scale_y_reverse
#' @importFrom rvg dml
#' @importFrom officer read_pptx add_slide ph_with ph_location

Expand Down Expand Up @@ -247,12 +248,19 @@ lineServer <- function(id, data, data_label, data_varStruct = NULL, nfactor.limi
}


ggpubr::ggline(data, input$x_line, input$y_line,
res.plot <- ggpubr::ggline(data, input$x_line, input$y_line,
color = color, add = add, add.params = add.params, conf.int = input$lineci,
xlab = label[variable == input$x_line, var_label][1],
ylab = label[variable == input$y_line, var_label][1], na.rm = T,
linetype = linetype
)

if (input$rev_y){
res.plot <- res.plot + ggplot2::scale_y_reverse()
}

return(res.plot)

})

output$downloadControls <- renderUI({
Expand Down

0 comments on commit 3beb4c8

Please sign in to comment.