Skip to content

Commit

Permalink
0004 release
Browse files Browse the repository at this point in the history
sbalci committed Mar 29, 2020
1 parent 2b844e0 commit a975fba
Showing 71 changed files with 3,637 additions and 417 deletions.
92 changes: 51 additions & 41 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,66 +1,76 @@
Package: ClinicoPath
Type: Package
Package: ClinicoPath
Title: Analysis for Clinicopathological Research
Version: 0.0.1.0002
Date: 2020-03-17
Version: 0.0.1.0004
Date: 2020-03-29
Authors@R:
person(given = "Serdar",
family = "Balci",
role = c("aut", "cre"),
email = "drserdarbalci@gmail.com",
comment = c(ORCID = "0000-0002-7852-3851"))
Maintainer: Serdar Balci <drserdarbalci@gmail.com>
Description: Analysis for Clinicopathological Research
ClinicoPath help researchers to generate natural language summaries of their
dataset, generate cross tables with statistical tests, and survival analysis
with survival tables, survival plots, and natural language summaries.
Description: Analysis for Clinicopathological Research
ClinicoPath help researchers to generate natural language summaries of
their dataset, generate cross tables with statistical tests, and
survival analysis with survival tables, survival plots, and natural
language summaries.
License: GPL-3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
URL: https://github.com/sbalci/ClinicoPathJamoviModule/,
https://sbalci.github.io/ClinicoPathJamoviModule/
BugReports:
https://github.com/sbalci/ClinicoPathJamoviModule/issues/
Depends:
R (>= 3.6)
Imports:
jmvcore (>= 0.8.5),
R6,
caret,
correlation,
dplyr,
survival,
survminer,
explore,
FFTrees,
finalfit,
arsenal,
purrr,
forcats,
ggalluvial,
ggplot2,
ggstatsplot,
glue,
irr,
janitor,
ggplot2,
forcats,
jmvcore (>= 0.8.5),
jsonlite,
knitr,
networkD3,
purrr,
R6,
report,
rlang,
scales,
survival,
survminer,
tableone,
tangram,
rlang,
knitr,
remotes,
tibble,
tidyr,
utils
Suggests:
rmarkdown,
tidyselect,
kableExtra,
ggstatsplot,
ggalluvial,
caret,
irr
yarrr,
circlize,
randomForest
VignetteBuilder:
knitr
Remotes:
r-lib/tidyselect,
ndphillips/FFTrees,
easystats/parameters,
easystats/bayestestR,
easystats/effectsize,
easystats/correlation,
easystats/modelbased,
easystats/insight,
easystats/bayestestR,
easystats/performance,
easystats/parameters,
easystats/report
Suggests:
effectsize,
emmeans,
rmarkdown,
igraph,
iterators,
rms,
commonmark,
sass
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.0.2
VignetteBuilder: knitr
URL: https://github.com/sbalci/ClinicoPathJamoviModule/, https://sbalci.github.io/ClinicoPathJamoviModule/
BugReports: https://github.com/sbalci/ClinicoPathJamoviModule/issues/
5 changes: 2 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Generated by roxygen2: do not edit by hand

export(agreement)
export(competingsurvival)
export(correlation)
export(crosstable)
export(decision)
export(decisioncalculator)
export(multisurvival)
export(reportcat)
export(statsplot2)
export(statsplotbetween)
export(summarydata)
export(survival)
export(tableone)
@@ -17,13 +19,10 @@ import(finalfit)
import(ggalluvial)
import(ggplot2)
import(ggstatsplot)
import(gt)
import(gtsummary)
import(jmvcore)
import(networkD3)
import(survival)
import(survminer)
import(tidyselect)
importFrom(R6,R6Class)
importFrom(ggalluvial,StatStratum)
importFrom(jmvcore,toNumeric)
16 changes: 15 additions & 1 deletion R/00jmv.R
Original file line number Diff line number Diff line change
@@ -227,4 +227,18 @@
`year`=2019,
`title`="ggalluvial: Alluvial Plots in 'ggplot2'.",
`publisher`="[R package]. Retrieved from https://CRAN.R-project.org/package=ggalluvial",
`url`="https://CRAN.R-project.org/package=ggalluvial"))
`url`="https://CRAN.R-project.org/package=ggalluvial"),
`explore`=list(
`type`="software",
`author`="Roland Krasser",
`year`=2020,
`title`="explore: Simplifies Exploratory Data Analysis.",
`publisher`="[R package]. Retrieved from https://CRAN.R-project.org/package=explore",
`url`="https://CRAN.R-project.org/package=explore"),
`FFTrees`=list(
`type`="software",
`author`="Nathaniel Phillips, Hansjoerg Neth, Jan Woike and Wolfgang Gaissmaer",
`year`=2019,
`title`="FFTrees: Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees",
`publisher`="[R package]. Retrieved from https://CRAN.R-project.org/package=FFTrees",
`url`="https://CRAN.R-project.org/package=FFTrees"))
5 changes: 3 additions & 2 deletions R/agreement.b.R
Original file line number Diff line number Diff line change
@@ -9,8 +9,6 @@ agreementClass <- if (requireNamespace('jmvcore')) R6::R6Class(

.run = function() {



if (length(self$options$vars) < 2)
return()

@@ -44,11 +42,14 @@ agreementClass <- if (requireNamespace('jmvcore')) R6::R6Class(
dplyr::select(myvars)


result <- table(ratings[,1], ratings[,2])

result1 <- irr::agree(ratings)

result2 <- irr::kappa2(ratings)


self$results$text$setContent(result)

self$results$text1$setContent(result1)

6 changes: 6 additions & 0 deletions R/agreement.h.R
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ agreementResults <- if (requireNamespace('jmvcore')) R6::R6Class(
inherit = jmvcore::Group,
active = list(
todo = function() private$.items[["todo"]],
text = function() private$.items[["text"]],
text1 = function() private$.items[["text1"]],
text2 = function() private$.items[["text2"]]),
private = list(),
@@ -44,6 +45,10 @@ agreementResults <- if (requireNamespace('jmvcore')) R6::R6Class(
options=options,
name="todo",
title="To Do"))
self$add(jmvcore::Preformatted$new(
options=options,
name="text",
title="Table"))
self$add(jmvcore::Preformatted$new(
options=options,
name="text1",
@@ -86,6 +91,7 @@ agreementBase <- if (requireNamespace('jmvcore')) R6::R6Class(
#' @return A results object containing:
#' \tabular{llllll}{
#' \code{results$todo} \tab \tab \tab \tab \tab a preformatted \cr
#' \code{results$text} \tab \tab \tab \tab \tab a preformatted \cr
#' \code{results$text1} \tab \tab \tab \tab \tab a preformatted \cr
#' \code{results$text2} \tab \tab \tab \tab \tab a preformatted \cr
#' }
18 changes: 18 additions & 0 deletions R/competingsurvival.b.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

# This file is a generated template, your changes will not be overwritten

competingsurvivalClass <- if (requireNamespace('jmvcore')) R6::R6Class(
"competingsurvivalClass",
inherit = competingsurvivalBase,
private = list(
.run = function() {

# https://finalfit.org/articles/survival.html#death-status


# `self$data` contains the data
# `self$options` contains the options
# `self$results` contains the results object (to populate)

})
)
137 changes: 137 additions & 0 deletions R/competingsurvival.h.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@

# This file is automatically generated, you probably don't want to edit this

competingsurvivalOptions <- if (requireNamespace('jmvcore')) R6::R6Class(
"competingsurvivalOptions",
inherit = jmvcore::Options,
public = list(
initialize = function(
dep = NULL,
group = NULL,
alt = "notequal",
varEq = TRUE, ...) {

super$initialize(
package='ClinicoPath',
name='competingsurvival',
requiresData=TRUE,
...)

private$..dep <- jmvcore::OptionVariable$new(
"dep",
dep)
private$..group <- jmvcore::OptionVariable$new(
"group",
group)
private$..alt <- jmvcore::OptionList$new(
"alt",
alt,
options=list(
"notequal",
"onegreater",
"twogreater"),
default="notequal")
private$..varEq <- jmvcore::OptionBool$new(
"varEq",
varEq,
default=TRUE)

self$.addOption(private$..dep)
self$.addOption(private$..group)
self$.addOption(private$..alt)
self$.addOption(private$..varEq)
}),
active = list(
dep = function() private$..dep$value,
group = function() private$..group$value,
alt = function() private$..alt$value,
varEq = function() private$..varEq$value),
private = list(
..dep = NA,
..group = NA,
..alt = NA,
..varEq = NA)
)

competingsurvivalResults <- if (requireNamespace('jmvcore')) R6::R6Class(
inherit = jmvcore::Group,
active = list(
text = function() private$.items[["text"]]),
private = list(),
public=list(
initialize=function(options) {
super$initialize(
options=options,
name="",
title="Competing Survival")
self$add(jmvcore::Preformatted$new(
options=options,
name="text",
title="Competing Survival"))}))

competingsurvivalBase <- if (requireNamespace('jmvcore')) R6::R6Class(
"competingsurvivalBase",
inherit = jmvcore::Analysis,
public = list(
initialize = function(options, data=NULL, datasetId="", analysisId="", revision=0) {
super$initialize(
package = 'ClinicoPath',
name = 'competingsurvival',
version = c(1,0,0),
options = options,
results = competingsurvivalResults$new(options=options),
data = data,
datasetId = datasetId,
analysisId = analysisId,
revision = revision,
pause = NULL,
completeWhenFilled = FALSE)
}))

#' Competing Survival
#'
#'
#' @param data .
#' @param dep .
#' @param group .
#' @param alt .
#' @param varEq .
#' @return A results object containing:
#' \tabular{llllll}{
#' \code{results$text} \tab \tab \tab \tab \tab a preformatted \cr
#' }
#'
#' @export
competingsurvival <- function(
data,
dep,
group,
alt = "notequal",
varEq = TRUE) {

if ( ! requireNamespace('jmvcore'))
stop('competingsurvival requires jmvcore to be installed (restart may be required)')

if ( ! missing(dep)) dep <- jmvcore::resolveQuo(jmvcore::enquo(dep))
if ( ! missing(group)) group <- jmvcore::resolveQuo(jmvcore::enquo(group))
if (missing(data))
data <- jmvcore::marshalData(
parent.frame(),
`if`( ! missing(dep), dep, NULL),
`if`( ! missing(group), group, NULL))


options <- competingsurvivalOptions$new(
dep = dep,
group = group,
alt = alt,
varEq = varEq)

analysis <- competingsurvivalClass$new(
options = options,
data = data)

analysis$run()

analysis$results
}
5 changes: 5 additions & 0 deletions R/multisurvival.b.R
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ multisurvivalClass <- if (requireNamespace('jmvcore')) R6::R6Class(
private = list(
.run = function() {


if (nrow(self$data) == 0)
stop('Data contains no (complete) rows')

@@ -55,6 +56,10 @@ multisurvivalClass <- if (requireNamespace('jmvcore')) R6::R6Class(
myoutcome2 <- self$options$outcome
myoutcome2 <- self$data[[myoutcome2]]
myoutcome2 <- na.omit(myoutcome2)

if(class(myoutcome2) == "factor")
stop("Please use a continuous variable for outcome.")

if (any(myoutcome2 != 0 & myoutcome2 != 1))
stop('Outcome variable must only contains 1s and 0s. If patient is dead or event (recurrence) occured it is 1. If censored (patient is alive or free of disease) at the last visit it is 0.')

Loading

0 comments on commit a975fba

Please sign in to comment.