Skip to content

Commit

Permalink
s
Browse files Browse the repository at this point in the history
  • Loading branch information
jinseob2kim committed Feb 14, 2021
1 parent c918a8f commit 4b1b6e9
Show file tree
Hide file tree
Showing 9 changed files with 487 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ License: Apache License 2.0
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.1
Imports: utils, stats, data.table, shiny, readxl, DT, jstable, labelled, methods, epiDisplay, GGally, ggplot2, haven, rstudioapi, shinycustomloader, MatchIt(>= 4.0.0), survey, tableone, jskm(>= 0.4.2), survival, purrr, geepack, maxstat, survC1, survIDINRI, timeROC, devEMF, graphics, grDevices, shinyWidgets, pROC, Hmisc, see, readr, RColorBrewer, Cairo
Imports: utils, stats, data.table, shiny, readxl, DT, jstable, labelled, methods, epiDisplay, GGally, ggplot2, haven, rstudioapi, shinycustomloader, MatchIt(>= 4.0.0), survey, tableone, jskm(>= 0.4.2), survival, purrr, geepack, maxstat, survC1, survIDINRI, timeROC, devEMF, graphics, grDevices, shinyWidgets, pROC, Hmisc, see, readr, RColorBrewer, Cairo, ggpubr
URL: https://github.com/jinseob2kim/jsmodule
BugReports: https://github.com/jinseob2kim/jsmodule/issues
Suggests:
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export(regressModuleUI)
export(rocModule)
export(rocModule2)
export(rocUI)
export(scatterServer)
export(scatterUI)
export(tb1module)
export(tb1module2)
export(tb1moduleUI)
Expand Down Expand Up @@ -79,6 +81,7 @@ importFrom(epiDisplay,regress.display)
importFrom(epiDisplay,tableGlm)
importFrom(geepack,geeglm)
importFrom(ggplot2,ggsave)
importFrom(ggpubr,ggscatter)
importFrom(grDevices,dev.off)
importFrom(haven,read_dta)
importFrom(haven,read_sas)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Fix & update

* New module `scatterplotUI` & `scatterplotServer`: scatterplot using **[ggpubr](https://rpkgs.datanovia.com/ggpubr/)**: apply to **Basic statistics**

* `timerocModule`, `rocModule`: Compare ROC curve even if there are different sample size(na omit)

* Change **timeby unit** from 1 to 0.5 (when <365)
Expand Down
38 changes: 36 additions & 2 deletions R/jsBasicGadget.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jsBasicGadget <- function(data, nfactor.limit = 20) {

),
navbarMenu("Plot", icon = icon("bar-chart-o"),
tabPanel("Scatter plot",
tabPanel("Basic plot",
sidebarLayout(
sidebarPanel(
ggpairsModuleUI1("ggpairs")
Expand All @@ -132,6 +132,17 @@ jsBasicGadget <- function(data, nfactor.limit = 20) {
)
)
),
tabPanel("Scatterplot",
sidebarLayout(
sidebarPanel(
scatterUI("scatter")
),
mainPanel(
withLoader(plotOutput("scatter_plot"), type="html", loader="loader6"),
ggplotdownUI("scatter")
)
)
),
tabPanel("Kaplan-meier plot",
sidebarLayout(
sidebarPanel(
Expand Down Expand Up @@ -474,6 +485,12 @@ jsBasicGadget <- function(data, nfactor.limit = 20) {
print(out_ggpairs())
})

out_scatter <- scatterServer("scatter", data = data, data_label = data.label, data_varStruct = NULL, nfactor.limit = nfactor.limit)

output$scatter_plot <- renderPlot({
print(out_scatter())
})

out_kaplan <- callModule(kaplanModule, "kaplan", data = data, data_label = data.label, data_varStruct = NULL, nfactor.limit = nfactor.limit)

output$kaplan_plot <- renderPlot({
Expand Down Expand Up @@ -646,7 +663,7 @@ jsBasicExtAddin <- function(nfactor.limit = 20, max.filesize = 2048){

),
navbarMenu("Plot", icon = icon("bar-chart-o"),
tabPanel("Scatter plot",
tabPanel("Basic plot",
sidebarLayout(
sidebarPanel(
ggpairsModuleUI1("ggpairs")
Expand All @@ -657,6 +674,17 @@ jsBasicExtAddin <- function(nfactor.limit = 20, max.filesize = 2048){
)
)
),
tabPanel("Scatterplot",
sidebarLayout(
sidebarPanel(
scatterUI("scatter")
),
mainPanel(
withLoader(plotOutput("scatter_plot"), type="html", loader="loader6"),
ggplotdownUI("scatter")
)
)
),
tabPanel("Kaplan-meier plot",
sidebarLayout(
sidebarPanel(
Expand Down Expand Up @@ -811,6 +839,12 @@ jsBasicExtAddin <- function(nfactor.limit = 20, max.filesize = 2048){
print(out_ggpairs())
})

out_scatter <- scatterServer("scatter", data = data, data_label = data.label, data_varStruct = NULL, nfactor.limit = nfactor.limit)

output$scatter_plot <- renderPlot({
print(out_scatter())
})

out_kaplan <- callModule(kaplanModule, "kaplan", data = data, data_label = data.label, data_varStruct = NULL, nfactor.limit = nfactor.limit)

output$kaplan_plot <- renderPlot({
Expand Down
2 changes: 1 addition & 1 deletion R/jsPropensityGadget.R
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ jsPropensityAddin <- function(){
#' @import shiny

jsPropensityExtAddin <- function(nfactor.limit = 20, max.filesize = 2048){

iptw <- NULL
options(shiny.maxRequestSize = max.filesize * 1024^2)

ui <- navbarPage("Propensity score analysis",
Expand Down
2 changes: 1 addition & 1 deletion R/kaplan.R
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ optionUI <- function(id) {
#' @param output output
#' @param session session
#' @param data Reactive data
#' @param data_label Reactuve data label
#' @param data_label Reactive data label
#' @param data_varStruct Reactive List of variable structure, Default: NULL
#' @param nfactor.limit nlevels limit in factor variable, Default: 10
#' @param design.survey Reactive survey data. default: NULL
Expand Down
Loading

0 comments on commit 4b1b6e9

Please sign in to comment.