Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
sbalci committed Dec 11, 2023
1 parent daaeae4 commit 269bf57
Show file tree
Hide file tree
Showing 20 changed files with 354 additions and 165 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: ClinicoPath
Title: Analysis for Clinicopathological Research
Version: 0.0.2.13
Date: 2023-12-10
Version: 0.0.2.14
Date: 2023-12-11
Authors@R:
person(given = "Serdar",
family = "Balci",
Expand Down
41 changes: 38 additions & 3 deletions R/multisurvival.h.R
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,11 @@ multisurvivalOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Cla
analysistype,
options=list(
"overall",
"cause"),
"cause",
"compete"),
default="overall")
private$..outcomeredifened <- jmvcore::OptionOutput$new(
"outcomeredifened")
private$..timetypedata <- jmvcore::OptionList$new(
"timetypedata",
timetypedata,
Expand Down Expand Up @@ -139,6 +142,8 @@ multisurvivalOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Cla
"landmark",
landmark,
default=3)
private$..calculatedtime <- jmvcore::OptionOutput$new(
"calculatedtime")
private$..hr <- jmvcore::OptionBool$new(
"hr",
hr,
Expand All @@ -165,10 +170,12 @@ multisurvivalOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Cla
self$.addOption(private$..contexpl)
self$.addOption(private$..multievent)
self$.addOption(private$..analysistype)
self$.addOption(private$..outcomeredifened)
self$.addOption(private$..timetypedata)
self$.addOption(private$..timetypeoutput)
self$.addOption(private$..uselandmark)
self$.addOption(private$..landmark)
self$.addOption(private$..calculatedtime)
self$.addOption(private$..hr)
self$.addOption(private$..sty)
}),
Expand All @@ -187,10 +194,12 @@ multisurvivalOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Cla
contexpl = function() private$..contexpl$value,
multievent = function() private$..multievent$value,
analysistype = function() private$..analysistype$value,
outcomeredifened = function() private$..outcomeredifened$value,
timetypedata = function() private$..timetypedata$value,
timetypeoutput = function() private$..timetypeoutput$value,
uselandmark = function() private$..uselandmark$value,
landmark = function() private$..landmark$value,
calculatedtime = function() private$..calculatedtime$value,
hr = function() private$..hr$value,
sty = function() private$..sty$value),
private = list(
Expand All @@ -208,10 +217,12 @@ multisurvivalOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Cla
..contexpl = NA,
..multievent = NA,
..analysistype = NA,
..outcomeredifened = NA,
..timetypedata = NA,
..timetypeoutput = NA,
..uselandmark = NA,
..landmark = NA,
..calculatedtime = NA,
..hr = NA,
..sty = NA)
)
Expand All @@ -225,7 +236,9 @@ multisurvivalResults <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Cla
text = function() private$.items[["text"]],
text2 = function() private$.items[["text2"]],
plot = function() private$.items[["plot"]],
plot3 = function() private$.items[["plot3"]]),
plot3 = function() private$.items[["plot3"]],
calculatedtime = function() private$.items[["calculatedtime"]],
outcomeredifened = function() private$.items[["outcomeredifened"]]),
private = list(),
public=list(
initialize=function(options) {
Expand Down Expand Up @@ -339,6 +352,26 @@ multisurvivalResults <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Cla
"fudate",
"dxdate",
"tint",
"multievent")))
self$add(jmvcore::Output$new(
options=options,
name="calculatedtime",
title="Add Calculated Time to Data",
varTitle="`Calculated Time in Multivariable Survival Function - from ${ dxdate } to { fudate }`",
varDescription="Calculated Time from given Dates",
clearWith=list(
"tint",
"dxdate",
"fudate")))
self$add(jmvcore::Output$new(
options=options,
name="outcomeredifened",
title="Add Redefined Outcome to Data",
varTitle="`Redefined Outcome in Multivariable Survival Function - from ${ outcome } for analysis { analysistype }`",
varDescription="Redefined Outcome from Outcome based on Analysis Type",
clearWith=list(
"outcome",
"analysistype",
"multievent")))}))

multisurvivalBase <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
Expand All @@ -359,7 +392,7 @@ multisurvivalBase <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
pause = NULL,
completeWhenFilled = FALSE,
requiresMissings = FALSE,
weightsSupport = 'auto')
weightsSupport = 'none')
}))

#' Multivariable Survival Analysis
Expand Down Expand Up @@ -399,6 +432,8 @@ multisurvivalBase <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
#' \code{results$text2} \tab \tab \tab \tab \tab a html \cr
#' \code{results$plot} \tab \tab \tab \tab \tab an image \cr
#' \code{results$plot3} \tab \tab \tab \tab \tab an image \cr
#' \code{results$calculatedtime} \tab \tab \tab \tab \tab an output \cr
#' \code{results$outcomeredifened} \tab \tab \tab \tab \tab an output \cr
#' }
#'
#' @export
Expand Down
36 changes: 18 additions & 18 deletions R/oddsratio.b.R
Original file line number Diff line number Diff line change
Expand Up @@ -236,24 +236,24 @@ oddsratioClass <- if (requireNamespace('jmvcore')) R6::R6Class(
# ) -> tOdds


self$results$textmydata$setContent(
list(
head = head(mydata),
names_data = names(mydata),
all_labels = all_labels,
explanatory_variable_names = explanatory_variable_names,
dependent_variable_name_from_label = dependent_variable_name_from_label,
formulaDependent = formulaDependent,
formulaExplanatory = formulaExplanatory
# formula2 = formula2,
# formulaR = formulaR,
# formulaL = formulaL,
# formulaL2 = formulaL2,
# formulaR3,
,
tOdds
)
)
# self$results$textmydata$setContent(
# list(
# head = head(mydata),
# names_data = names(mydata),
# all_labels = all_labels,
# explanatory_variable_names = explanatory_variable_names,
# dependent_variable_name_from_label = dependent_variable_name_from_label,
# formulaDependent = formulaDependent,
# formulaExplanatory = formulaExplanatory
# # formula2 = formula2,
# # formulaR = formulaR,
# # formulaL = formulaL,
# # formulaL2 = formulaL2,
# # formulaR3,
# ,
# tOdds
# )
# )


text2 <- glue::glue("
Expand Down
6 changes: 0 additions & 6 deletions R/oddsratio.h.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ oddsratioResults <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
inherit = jmvcore::Group,
active = list(
todo = function() private$.items[["todo"]],
textmydata = function() private$.items[["textmydata"]],
text = function() private$.items[["text"]],
text2 = function() private$.items[["text2"]],
plot = function() private$.items[["plot"]]),
Expand All @@ -65,10 +64,6 @@ oddsratioResults <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
clearWith=list(
"explanatory",
"outcome")))
self$add(jmvcore::Preformatted$new(
options=options,
name="textmydata",
title="textmydata"))
self$add(jmvcore::Html$new(
options=options,
name="text",
Expand Down Expand Up @@ -127,7 +122,6 @@ oddsratioBase <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
#' @return A results object containing:
#' \tabular{llllll}{
#' \code{results$todo} \tab \tab \tab \tab \tab a html \cr
#' \code{results$textmydata} \tab \tab \tab \tab \tab a preformatted \cr
#' \code{results$text} \tab \tab \tab \tab \tab a html \cr
#' \code{results$text2} \tab \tab \tab \tab \tab a html \cr
#' \code{results$plot} \tab \tab \tab \tab \tab an image \cr
Expand Down
37 changes: 35 additions & 2 deletions R/singlearm.h.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ singlearmOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
ce = FALSE,
ch = FALSE,
endplot = 60,
ybegin_plot = 0,
yend_plot = 1,
byplot = 12,
multievent = FALSE,
ci95 = FALSE,
Expand Down Expand Up @@ -56,6 +58,8 @@ singlearmOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
private$..fudate <- jmvcore::OptionVariable$new(
"fudate",
fudate)
private$..calculatedtime <- jmvcore::OptionOutput$new(
"calculatedtime")
private$..outcome <- jmvcore::OptionVariable$new(
"outcome",
outcome,
Expand Down Expand Up @@ -95,8 +99,11 @@ singlearmOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
analysistype,
options=list(
"overall",
"cause"),
"cause",
"compete"),
default="overall")
private$..outcomeredifened <- jmvcore::OptionOutput$new(
"outcomeredifened")
private$..cutp <- jmvcore::OptionString$new(
"cutp",
cutp,
Expand Down Expand Up @@ -150,6 +157,14 @@ singlearmOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
"endplot",
endplot,
default=60)
private$..ybegin_plot <- jmvcore::OptionNumber$new(
"ybegin_plot",
ybegin_plot,
default=0)
private$..yend_plot <- jmvcore::OptionNumber$new(
"yend_plot",
yend_plot,
default=1)
private$..byplot <- jmvcore::OptionInteger$new(
"byplot",
byplot,
Expand All @@ -175,13 +190,15 @@ singlearmOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
self$.addOption(private$..tint)
self$.addOption(private$..dxdate)
self$.addOption(private$..fudate)
self$.addOption(private$..calculatedtime)
self$.addOption(private$..outcome)
self$.addOption(private$..outcomeLevel)
self$.addOption(private$..dod)
self$.addOption(private$..dooc)
self$.addOption(private$..awd)
self$.addOption(private$..awod)
self$.addOption(private$..analysistype)
self$.addOption(private$..outcomeredifened)
self$.addOption(private$..cutp)
self$.addOption(private$..timetypedata)
self$.addOption(private$..timetypeoutput)
Expand All @@ -192,6 +209,8 @@ singlearmOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
self$.addOption(private$..ce)
self$.addOption(private$..ch)
self$.addOption(private$..endplot)
self$.addOption(private$..ybegin_plot)
self$.addOption(private$..yend_plot)
self$.addOption(private$..byplot)
self$.addOption(private$..multievent)
self$.addOption(private$..ci95)
Expand All @@ -203,13 +222,15 @@ singlearmOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
tint = function() private$..tint$value,
dxdate = function() private$..dxdate$value,
fudate = function() private$..fudate$value,
calculatedtime = function() private$..calculatedtime$value,
outcome = function() private$..outcome$value,
outcomeLevel = function() private$..outcomeLevel$value,
dod = function() private$..dod$value,
dooc = function() private$..dooc$value,
awd = function() private$..awd$value,
awod = function() private$..awod$value,
analysistype = function() private$..analysistype$value,
outcomeredifened = function() private$..outcomeredifened$value,
cutp = function() private$..cutp$value,
timetypedata = function() private$..timetypedata$value,
timetypeoutput = function() private$..timetypeoutput$value,
Expand All @@ -220,6 +241,8 @@ singlearmOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
ce = function() private$..ce$value,
ch = function() private$..ch$value,
endplot = function() private$..endplot$value,
ybegin_plot = function() private$..ybegin_plot$value,
yend_plot = function() private$..yend_plot$value,
byplot = function() private$..byplot$value,
multievent = function() private$..multievent$value,
ci95 = function() private$..ci95$value,
Expand All @@ -230,13 +253,15 @@ singlearmOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
..tint = NA,
..dxdate = NA,
..fudate = NA,
..calculatedtime = NA,
..outcome = NA,
..outcomeLevel = NA,
..dod = NA,
..dooc = NA,
..awd = NA,
..awod = NA,
..analysistype = NA,
..outcomeredifened = NA,
..cutp = NA,
..timetypedata = NA,
..timetypeoutput = NA,
Expand All @@ -247,6 +272,8 @@ singlearmOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
..ce = NA,
..ch = NA,
..endplot = NA,
..ybegin_plot = NA,
..yend_plot = NA,
..byplot = NA,
..multievent = NA,
..ci95 = NA,
Expand Down Expand Up @@ -554,7 +581,7 @@ singlearmBase <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
pause = NULL,
completeWhenFilled = FALSE,
requiresMissings = FALSE,
weightsSupport = 'auto')
weightsSupport = 'none')
}))

#' Single Arm Survival
Expand Down Expand Up @@ -586,6 +613,8 @@ singlearmBase <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
#' @param ce .
#' @param ch .
#' @param endplot .
#' @param ybegin_plot .
#' @param yend_plot .
#' @param byplot .
#' @param multievent .
#' @param ci95 .
Expand Down Expand Up @@ -636,6 +665,8 @@ singlearm <- function(
ce = FALSE,
ch = FALSE,
endplot = 60,
ybegin_plot = 0,
yend_plot = 1,
byplot = 12,
multievent = FALSE,
ci95 = FALSE,
Expand Down Expand Up @@ -680,6 +711,8 @@ singlearm <- function(
ce = ce,
ch = ch,
endplot = endplot,
ybegin_plot = ybegin_plot,
yend_plot = yend_plot,
byplot = byplot,
multievent = multievent,
ci95 = ci95,
Expand Down
Loading

0 comments on commit 269bf57

Please sign in to comment.