diff --git a/DESCRIPTION b/DESCRIPTION index 7135c12d..7a31e295 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: ClinicoPath Title: Analysis for Clinicopathological Research -Version: 0.0.2.0013 -Date: 2020-06-12 +Version: 0.0.2.0015 +Date: 2020-06-28 Authors@R: person(given = "Serdar", family = "Balci", @@ -51,7 +51,6 @@ Suggests: rpart, rpart.plot, plotROC, - arsenal, easyalluvial, corrr, correlation, @@ -70,13 +69,17 @@ Suggests: pkgnet, hrbrthemes, gtsummary, - vctrs + vctrs, + retractcheck, + RefManageR, + rcrossref Remotes: ndphillips/FFTrees, easystats/report, spgarbet/tangram, cran/rmngb, - mixOmicsTeam/mixOmics + mixOmicsTeam/mixOmics, + mayoverse/arsenal VignetteBuilder: knitr Encoding: UTF-8 diff --git a/NAMESPACE b/NAMESPACE index bdb97d46..6ace72a6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -23,6 +23,7 @@ export(multisurvival) export(oddsratio) export(pairchi2) export(reportcat) +export(retracted) export(roc) export(statsplot2) export(summarydata) diff --git a/NEWS.md b/NEWS.md index f71fd588..59c03839 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,22 @@ +# ClinicoPath 0.0.2.0015 + +- Added tangram statistical results +- Added options to finalfit crosstables +fixes: https://github.com/sbalci/ClinicoPathJamoviModule/issues/24 +fixes: https://github.com/jamovi/jamovi/issues/901 +fixes: https://github.com/ewenharrison/finalfit/issues/52 + +- Added experimental biblometrics functions +- includes experimental changes + + + +# ClinicoPath 0.0.2.0014 + +- Added footnote to arsenal crosstable + + + # ClinicoPath 0.0.2.0012 - jjstatsplot is the wrapper functions for using ggstatsplot in jamovi. diff --git a/R/00jmv.R b/R/00jmv.R index c1668539..01d86137 100644 --- a/R/00jmv.R +++ b/R/00jmv.R @@ -311,4 +311,25 @@ `year`=2020, `title`="hrbrthemes: Additional Themes, Theme Components and Utilities for 'ggplot2'.", `publisher`="[R package]. Retrieved from https://CRAN.R-project.org/package=hrbrthemes", - `url`="https://CRAN.R-project.org/package=hrbrthemes")) + `url`="https://CRAN.R-project.org/package=hrbrthemes"), + `retractcheck`=list( + `type`="software", + `author`=NULL, + `year`=NULL, + `title`="", + `publisher`="[R package]. Retrieved from https://CRAN.R-project.org/package=", + `url`="https://CRAN.R-project.org/package="), + `RefManageR`=list( + `type`="software", + `author`=NULL, + `year`=NULL, + `title`="", + `publisher`="[R package]. Retrieved from https://CRAN.R-project.org/package=", + `url`="https://CRAN.R-project.org/package="), + `rcrossref`=list( + `type`="software", + `author`=NULL, + `year`=NULL, + `title`="", + `publisher`="[R package]. Retrieved from https://CRAN.R-project.org/package=", + `url`="https://CRAN.R-project.org/package=")) diff --git a/R/crosstable.b.R b/R/crosstable.b.R index 5e0717c2..386cc101 100644 --- a/R/crosstable.b.R +++ b/R/crosstable.b.R @@ -13,13 +13,20 @@ crosstableClass <- if (requireNamespace('jmvcore')) R6::R6Class( .run = function() { + + # Select Style ---- + + sty <- self$options$sty + + + + if (is.null(self$options$vars) || is.null(self$options$group)) { # ToDo Message ---- todo <- glue::glue("
- 21:02
Welcome to ClinicoPath.
This tool will help you form a Cross Table.
The functions select hypothesis tests automatically. You may see different results with different tables. Please verify your data distribution and appropriateness of the test accordingly. You may find Statkat module useful.
@@ -35,6 +42,23 @@ crosstableClass <- if (requireNamespace('jmvcore')) R6::R6Class( html <- self$results$todo html$setContent(todo) + + if (sty == "finalfit") { + + + todo <- glue::glue(" +
+ finalfit uses + aov (analysis of variance) or t.test for Welch two sample t-test. Note continuous non-parametric test is always Kruskal Wallis (kruskal.test) which in two-group setting is equivalent to Mann-Whitney U /Wilcoxon rank sum test. See full documentation here. + " + ) + + + html <- self$results$todo + html$setContent(todo) + + } + # Error Message ---- if (nrow(self$data) == 0) stop("Data contains no (complete) rows") @@ -63,10 +87,6 @@ crosstableClass <- if (requireNamespace('jmvcore')) R6::R6Class( if (excl) {mydata <- jmvcore::naOmit(mydata)} - # Select Style ---- - - sty <- self$options$sty - # tab3 <- CreateTableOne(vars = myVars, strata = "trt" , data = pbc, factorVars = catVars) @@ -85,18 +105,24 @@ crosstableClass <- if (requireNamespace('jmvcore')) R6::R6Class( tablearsenal <- summary(tablearsenal, text = 'html', - pfootnote = TRUE + pfootnote = 'html' ) + # tablearsenal_output <- capture.output(tablearsenal) - tablearsenal <- - kableExtra::kable(tablearsenal, - format = "html", - digits = 1, - escape = FALSE - ) + # self$results$tablearsenal_output$setContent(tablearsenal_output) + # tablearsenal <- + # kableExtra::kable(tablearsenal, + # format = "html", + # digits = 1, + # escape = FALSE + # ) + + + tablearsenal <- capture.output(tablearsenal) + self$results$tablestyle1$setContent(tablearsenal) @@ -104,6 +130,7 @@ crosstableClass <- if (requireNamespace('jmvcore')) R6::R6Class( # FinalFit ---- # https://finalfit.org/articles/tables_gallery.html#cross-tables + # https://finalfit.org/reference/summary_factorlist.html myvars <- jmvcore::composeTerm(components = self$options$vars) @@ -118,17 +145,57 @@ crosstableClass <- if (requireNamespace('jmvcore')) R6::R6Class( .data = ., dependent = self$options$group, explanatory = myvars, - # column = TRUE, total_col = TRUE, p = TRUE, add_dependent_label = TRUE, na_include = FALSE, - na_to_p = FALSE + na_to_p = FALSE, + cont = self$options$cont, + cont_range = TRUE, + + + p_cont_para = "aov", + p_cat = self$options$pcat, + + + + + + + + + cont_nonpara = NULL, + cont_cut = 5, + dependent_label_prefix = "Dependent: ", + dependent_label_suffix = "", + row_totals_colname = "Total N", + row_missing_colname = "Missing N", + + + + + column = TRUE, + orderbytotal = FALSE, + digits = c(1, 1, 3, 1), + na_include_dependent = FALSE, + na_complete_cases = FALSE, + fit_id = FALSE, + add_col_totals = FALSE, + include_col_totals_percent = TRUE, + col_totals_rowname = NULL, + col_totals_prefix = "", + add_row_totals = FALSE, + include_row_missing_col = TRUE - # catTest = catTestfisher ) -> tablefinalfit + + + + + + tablefinalfit <- kableExtra::kable(tablefinalfit, format = "html", digits = 1, @@ -183,6 +250,7 @@ crosstableClass <- if (requireNamespace('jmvcore')) R6::R6Class( mydata, transform=tangram::hmisc, id = "tbl3", + test = TRUE, digits = 1, include_p = TRUE ), @@ -195,16 +263,9 @@ crosstableClass <- if (requireNamespace('jmvcore')) R6::R6Class( self$results$tablestyle4$setContent(tabletangram) } - - - - # tableone ---- # tab3 <- CreateTableOne(vars = myVars, strata = "trt" , data = pbc, factorVars = catVars) - - - } }) ) diff --git a/R/crosstable.h.R b/R/crosstable.h.R index b4e19676..16be2ec6 100644 --- a/R/crosstable.h.R +++ b/R/crosstable.h.R @@ -9,7 +9,9 @@ crosstableOptions <- if (requireNamespace('jmvcore')) R6::R6Class( vars = NULL, group = NULL, sty = "nejm", - excl = TRUE, ...) { + excl = TRUE, + cont = "mean", + pcat = "chisq", ...) { super$initialize( package='ClinicoPath', @@ -43,22 +45,42 @@ crosstableOptions <- if (requireNamespace('jmvcore')) R6::R6Class( "excl", excl, default=TRUE) + private$..cont <- jmvcore::OptionList$new( + "cont", + cont, + options=list( + "mean", + "median"), + default="mean") + private$..pcat <- jmvcore::OptionList$new( + "pcat", + pcat, + options=list( + "chisq", + "fisher"), + default="chisq") self$.addOption(private$..vars) self$.addOption(private$..group) self$.addOption(private$..sty) self$.addOption(private$..excl) + self$.addOption(private$..cont) + self$.addOption(private$..pcat) }), active = list( vars = function() private$..vars$value, group = function() private$..group$value, sty = function() private$..sty$value, - excl = function() private$..excl$value), + excl = function() private$..excl$value, + cont = function() private$..cont$value, + pcat = function() private$..pcat$value), private = list( ..vars = NA, ..group = NA, ..sty = NA, - ..excl = NA) + ..excl = NA, + ..cont = NA, + ..pcat = NA) ) crosstableResults <- if (requireNamespace('jmvcore')) R6::R6Class( @@ -82,7 +104,9 @@ crosstableResults <- if (requireNamespace('jmvcore')) R6::R6Class( title="To Do", clearWith=list( "vars", - "group"))) + "group", + "cont", + "pcat"))) self$add(jmvcore::Html$new( options=options, name="tablestyle1", @@ -98,7 +122,9 @@ crosstableResults <- if (requireNamespace('jmvcore')) R6::R6Class( title="`Cross Table - ${group}`", clearWith=list( "vars", - "group"), + "group", + "cont", + "pcat"), visible="(sty:finalfit)", refs="finalfit")) self$add(jmvcore::Html$new( @@ -153,6 +179,8 @@ crosstableBase <- if (requireNamespace('jmvcore')) R6::R6Class( #' @param group variable in the column #' @param sty . #' @param excl . +#' @param cont . +#' @param pcat . #' @return A results object containing: #' \tabular{llllll}{ #' \code{results$todo} \tab \tab \tab \tab \tab a html \cr @@ -168,7 +196,9 @@ crosstable <- function( vars, group, sty = "nejm", - excl = TRUE) { + excl = TRUE, + cont = "mean", + pcat = "chisq") { if ( ! requireNamespace('jmvcore')) stop('crosstable requires jmvcore to be installed (restart may be required)') @@ -187,7 +217,9 @@ crosstable <- function( vars = vars, group = group, sty = sty, - excl = excl) + excl = excl, + cont = cont, + pcat = pcat) analysis <- crosstableClass$new( options = options, diff --git a/R/multisurvival.b.R b/R/multisurvival.b.R index b80181e0..5b62bd13 100644 --- a/R/multisurvival.b.R +++ b/R/multisurvival.b.R @@ -118,7 +118,7 @@ multisurvivalClass <- if (requireNamespace('jmvcore')) R6::R6Class( finalfit::finalfit(.data = mydata, dependent = myformula, explanatory = formula2, - # , + # metrics = TRUE ) -> tMultivariate diff --git a/R/retracted.b.R b/R/retracted.b.R new file mode 100644 index 00000000..14c35681 --- /dev/null +++ b/R/retracted.b.R @@ -0,0 +1,101 @@ +#' @title Find Retracted Papers from DOI +#' +#' +#' +#' @importFrom R6 R6Class +#' @import jmvcore +#' + + +retractedClass <- if (requireNamespace('jmvcore')) R6::R6Class( + "retractedClass", + inherit = retractedBase, + private = list( + .run = function() { + + + if (is.null(self$options$doi)) + return() + + mydata <- self$data + + doi <- self$options$doi + + doi_list <- mydata[[doi]] + + doi_list <- as.vector(doi_list) + + # self$results$text$setContent( + # list( + # doi_list, + # typeof(doi_list), + # class(doi_list) + # ) + # ) + + # retracted_list <- list() #create an empty list + # + # for (i in 1:length(doi_list)) { + # + # retracted_list[[i]] <- + # retractcheck::retractcheck( + # dois = doi_list[i], + # database = "or", + # # database = "rw", + # return = "all" + # # return = "unique" + # ) + # } + # retracted_list <- do.call("rbind",retracted_list) + + retracted_list <- + retractcheck::retractcheck( + dois = doi_list, + database = "or", + # database = "rw", + return = "all" + # return = "unique" + ) + + table_retracted_list <- kableExtra::kable( + retracted_list, + format = "html" + ) + + + + # self$results$text2$setContent(table_retracted_list) + + + + info_list <- + RefManageR::GetBibEntryWithDOI(doi = doi_list) + + + table_info_list <- kableExtra::kable( + info_list, + format = "html" + ) + + + + # self$results$text3$setContent(table_info_list) + + + + ids <- rcrossref::id_converter(x = doi_list, type = "doi") + + table_ids <- ids[["records"]] + + table_table_ids <- kableExtra::kable( + table_ids, + format = "html" + ) + + + self$results$text4$setContent(table_table_ids) + + + + }) +) diff --git a/R/retracted.h.R b/R/retracted.h.R new file mode 100644 index 00000000..e8d21153 --- /dev/null +++ b/R/retracted.h.R @@ -0,0 +1,100 @@ + +# This file is automatically generated, you probably don't want to edit this + +retractedOptions <- if (requireNamespace('jmvcore')) R6::R6Class( + "retractedOptions", + inherit = jmvcore::Options, + public = list( + initialize = function( + doi = NULL, ...) { + + super$initialize( + package='ClinicoPath', + name='retracted', + requiresData=TRUE, + ...) + + private$..doi <- jmvcore::OptionVariable$new( + "doi", + doi) + + self$.addOption(private$..doi) + }), + active = list( + doi = function() private$..doi$value), + private = list( + ..doi = NA) +) + +retractedResults <- if (requireNamespace('jmvcore')) R6::R6Class( + inherit = jmvcore::Group, + active = list( + text4 = function() private$.items[["text4"]]), + private = list(), + public=list( + initialize=function(options) { + super$initialize( + options=options, + name="", + title="Find Retracted Papers from DOI") + self$add(jmvcore::Html$new( + options=options, + name="text4", + title="id convert"))})) + +retractedBase <- if (requireNamespace('jmvcore')) R6::R6Class( + "retractedBase", + inherit = jmvcore::Analysis, + public = list( + initialize = function(options, data=NULL, datasetId="", analysisId="", revision=0) { + super$initialize( + package = 'ClinicoPath', + name = 'retracted', + version = c(1,0,0), + options = options, + results = retractedResults$new(options=options), + data = data, + datasetId = datasetId, + analysisId = analysisId, + revision = revision, + pause = NULL, + completeWhenFilled = FALSE, + requiresMissings = FALSE) + })) + +#' Find Retracted Papers from DOI +#' +#' +#' @param data . +#' @param doi . +#' @return A results object containing: +#' \tabular{llllll}{ +#' \code{results$text4} \tab \tab \tab \tab \tab a html \cr +#' } +#' +#' @export +retracted <- function( + data, + doi) { + + if ( ! requireNamespace('jmvcore')) + stop('retracted requires jmvcore to be installed (restart may be required)') + + if ( ! missing(doi)) doi <- jmvcore::resolveQuo(jmvcore::enquo(doi)) + if (missing(data)) + data <- jmvcore::marshalData( + parent.frame(), + `if`( ! missing(doi), doi, NULL)) + + + options <- retractedOptions$new( + doi = doi) + + analysis <- retractedClass$new( + options = options, + data = data) + + analysis$run() + + analysis$results +} diff --git a/R/tree.b.R b/R/tree.b.R index 5fa8443f..d881e4a8 100644 --- a/R/tree.b.R +++ b/R/tree.b.R @@ -52,14 +52,14 @@ treeClass <- if (requireNamespace('jmvcore')) R6::R6Class( mydata <- jmvcore::naOmit(mydata) - sumdata <- list(typeof(mydata), - class(mydata), - head(mydata), - head(as.data.frame(mydata)), - summary(mydata)) + # sumdata <- list(typeof(mydata), + # class(mydata), + # head(mydata), + # head(as.data.frame(mydata)), + # summary(mydata)) - self$results$text1$setContent(sumdata) + # self$results$text1$setContent(sumdata) @@ -85,7 +85,7 @@ treeClass <- if (requireNamespace('jmvcore')) R6::R6Class( tree <- rpart::rpart(myformula, data = mydata, cp = .02) - self$results$text2$setContent(tree) + # self$results$text2$setContent(tree) # FFTrees ---- @@ -113,16 +113,7 @@ treeClass <- if (requireNamespace('jmvcore')) R6::R6Class( - self$results$text2$setContent(mydata) - - - - - - - - - + # self$results$text2$setContent(mydata) } diff --git a/R/tree.h.R b/R/tree.h.R index c1601699..094b5178 100644 --- a/R/tree.h.R +++ b/R/tree.h.R @@ -79,7 +79,10 @@ treeResults <- if (requireNamespace('jmvcore')) R6::R6Class( active = list( todo = function() private$.items[["todo"]], text1 = function() private$.items[["text1"]], - text2 = function() private$.items[["text2"]]), + text2 = function() private$.items[["text2"]], + plot1 = function() private$.items[["plot1"]], + plot2 = function() private$.items[["plot2"]], + plot3 = function() private$.items[["plot3"]]), private = list(), public=list( initialize=function(options) { @@ -118,6 +121,56 @@ treeResults <- if (requireNamespace('jmvcore')) R6::R6Class( "targetLevel", "sty"), visible="(sty:rpart || sty:fftrees)", + refs=list( + "rpart", + "rpart.plot"))) + self$add(jmvcore::Image$new( + options=options, + name="plot1", + title="Decision Tree Explore", + width=600, + height=450, + renderFun=".plot1", + requiresData=TRUE, + clearWith=list( + "vars", + "facs", + "target", + "targetLevel", + "sty"), + visible="(sty:explore)", + refs="explore")) + self$add(jmvcore::Image$new( + options=options, + name="plot2", + title="Decision Tree FFTrees", + width=600, + height=450, + renderFun=".plot2", + requiresData=TRUE, + clearWith=list( + "vars", + "facs", + "target", + "targetLevel", + "sty"), + visible="(sty:fftrees)", + refs="FFTrees")) + self$add(jmvcore::Image$new( + options=options, + name="plot3", + title="Decision Tree rpart", + width=600, + height=450, + renderFun=".plot3", + requiresData=TRUE, + clearWith=list( + "vars", + "facs", + "target", + "targetLevel", + "sty"), + visible="(sty:rpart)", refs=list( "rpart", "rpart.plot")))})) @@ -161,6 +214,9 @@ treeBase <- if (requireNamespace('jmvcore')) R6::R6Class( #' \code{results$todo} \tab \tab \tab \tab \tab a html \cr #' \code{results$text1} \tab \tab \tab \tab \tab a preformatted \cr #' \code{results$text2} \tab \tab \tab \tab \tab a preformatted \cr +#' \code{results$plot1} \tab \tab \tab \tab \tab an image \cr +#' \code{results$plot2} \tab \tab \tab \tab \tab an image \cr +#' \code{results$plot3} \tab \tab \tab \tab \tab an image \cr #' } #' #' @export diff --git a/codemeta.json b/codemeta.json index e9ab64a7..4e753a62 100644 --- a/codemeta.json +++ b/codemeta.json @@ -14,7 +14,7 @@ ], "issueTracker": "\n https://github.com/sbalci/ClinicoPathJamoviModule/issues/", "license": "https://spdx.org/licenses/GPL-3.0", - "version": "0.0.2.13", + "version": "0.0.2.15", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", @@ -308,18 +308,6 @@ }, "sameAs": "https://CRAN.R-project.org/package=plotROC" }, - { - "@type": "SoftwareApplication", - "identifier": "arsenal", - "name": "arsenal", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=arsenal" - }, { "@type": "SoftwareApplication", "identifier": "easyalluvial", @@ -547,6 +535,42 @@ "url": "https://cran.r-project.org" }, "sameAs": "https://CRAN.R-project.org/package=vctrs" + }, + { + "@type": "SoftwareApplication", + "identifier": "retractcheck", + "name": "retractcheck", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=retractcheck" + }, + { + "@type": "SoftwareApplication", + "identifier": "RefManageR", + "name": "RefManageR", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=RefManageR" + }, + { + "@type": "SoftwareApplication", + "identifier": "rcrossref", + "name": "rcrossref", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=rcrossref" } ], "softwareRequirements": [ @@ -633,6 +657,6 @@ "survival-analysis", "natural-language-summaries" ], - "fileSize": "299.338KB", + "fileSize": "301.543KB", "readme": "https://github.com/sbalci/ClinicoPathJamoviModule/blob/master/README.md" } diff --git a/data/histopathology.omv b/data/histopathology.omv index 96e32c5d..e21b35f6 100644 Binary files a/data/histopathology.omv and b/data/histopathology.omv differ diff --git a/data/retractiondoi.omv b/data/retractiondoi.omv new file mode 100644 index 00000000..ebf2a05b Binary files /dev/null and b/data/retractiondoi.omv differ diff --git a/inst/extdata/histopathology.omv b/inst/extdata/histopathology.omv index 141767ab..e21b35f6 100644 Binary files a/inst/extdata/histopathology.omv and b/inst/extdata/histopathology.omv differ diff --git a/inst/extdata/retractiondoi.omv b/inst/extdata/retractiondoi.omv new file mode 100644 index 00000000..ebf2a05b Binary files /dev/null and b/inst/extdata/retractiondoi.omv differ diff --git a/jamovi/0000.yaml b/jamovi/0000.yaml index 919ad532..ab12a056 100644 --- a/jamovi/0000.yaml +++ b/jamovi/0000.yaml @@ -1,12 +1,12 @@ --- title: Common Analysis for Clinicopathological Research name: ClinicoPath -version: 0.0.2.0013 +version: 0.0.2.0015 jms: '1.0' authors: - Serdar Balci maintainer: Serdar Balci -date: '2020-06-12' +date: '2020-06-28' type: R description: >- ClinicoPath help researchers to generate natural language summaries of their @@ -261,6 +261,12 @@ analyses: description: | 'Wrapper Function for ggstatsplot::ggbarstats and ggstatsplot::grouped_ggbarstats to generate Bar Charts.' + - title: Find Retracted Papers from DOI + name: retracted + ns: ClinicoPath + menuGroup: Drafts + menuTitle: Find Retracted Papers from DOI + menuSubgroup: Bibliometrics datasets: - name: histopathology including analysis path: histopathologyanalysis.omv diff --git a/jamovi/00refs.yaml b/jamovi/00refs.yaml index 0a7dee48..ac5b2bf7 100644 --- a/jamovi/00refs.yaml +++ b/jamovi/00refs.yaml @@ -363,5 +363,31 @@ refs: url: https://CRAN.R-project.org/package=hrbrthemes + retractcheck: + type: 'software' + author: + year: + title: "" + publisher: '[R package]. Retrieved from https://CRAN.R-project.org/package=' + url: https://CRAN.R-project.org/package= + + + RefManageR: + type: 'software' + author: + year: + title: "" + publisher: '[R package]. Retrieved from https://CRAN.R-project.org/package=' + url: https://CRAN.R-project.org/package= + + + rcrossref: + type: 'software' + author: + year: + title: "" + publisher: '[R package]. Retrieved from https://CRAN.R-project.org/package=' + url: https://CRAN.R-project.org/package= + ... diff --git a/jamovi/crosstable.a.yaml b/jamovi/crosstable.a.yaml index a3b991ca..2e80b5cc 100644 --- a/jamovi/crosstable.a.yaml +++ b/jamovi/crosstable.a.yaml @@ -56,12 +56,40 @@ options: name: hmisc default: nejm - - name: excl title: Exclude Missing (NA) type: Bool default: true + + - name: cont + title: Mean vs Median + type: List + options: + - title: mean + name: mean + - title: median + name: median + default: mean + + + - name: pcat + title: ChiSq vs Fisher + type: List + options: + - title: chisq + name: chisq + - title: fisher + name: fisher + default: chisq + + + + + + + + # - name: excl2 # title: Exclude Missing per Variable (NA) # type: Bool diff --git a/jamovi/crosstable.r.yaml b/jamovi/crosstable.r.yaml index d3cb5d62..20719fdc 100644 --- a/jamovi/crosstable.r.yaml +++ b/jamovi/crosstable.r.yaml @@ -11,7 +11,15 @@ items: clearWith: - vars - group + - cont + - pcat + # - name: tablearsenal_output + # title: tablearsenal_output + # type: Html + # clearWith: + # - vars + # - group - name: tablestyle1 title: '`Cross Table - ${group}`' @@ -29,6 +37,8 @@ items: clearWith: - vars - group + - cont + - pcat visible: (sty:finalfit) refs: finalfit diff --git a/jamovi/crosstable.u.yaml b/jamovi/crosstable.u.yaml index a7a9e176..ee31e06d 100644 --- a/jamovi/crosstable.u.yaml +++ b/jamovi/crosstable.u.yaml @@ -2,7 +2,7 @@ title: Cross Tables name: crosstable jus: '3.0' stage: 0 -compilerMode: aggressive +compilerMode: tame children: - type: VariableSupplier persistentItems: false @@ -31,3 +31,15 @@ children: children: - type: CheckBox name: excl + - type: LayoutBox + margin: large + children: + - type: ComboBox + name: cont + enable: (sty:finalfit) + - type: LayoutBox + margin: large + children: + - type: ComboBox + name: pcat + enable: (sty:finalfit) diff --git a/jamovi/retracted.a.yaml b/jamovi/retracted.a.yaml new file mode 100644 index 00000000..18b025ab --- /dev/null +++ b/jamovi/retracted.a.yaml @@ -0,0 +1,17 @@ +--- +name: retracted +title: Find Retracted Papers from DOI +menuGroup: Drafts +menuSubgroup: Bibliometrics +version: '1.0.0' +jas: '1.2' + +options: + - name: data + type: Data + + - name: doi + title: Select DOI Variable + type: Variable + +... diff --git a/jamovi/retracted.r.yaml b/jamovi/retracted.r.yaml new file mode 100644 index 00000000..d6738310 --- /dev/null +++ b/jamovi/retracted.r.yaml @@ -0,0 +1,27 @@ +--- +name: retracted +title: Find Retracted Papers from DOI +jrs: '1.1' + +items: + # - name: text + # title: Find Retracted Papers from DOI + # type: Preformatted + + # - name: text2 + # title: 'Find Retracted Papers from DOI' + # type: Html + + + # - name: text3 + # title: 'GetBibEntryWithDOI' + # type: Html + + + - name: text4 + title: 'id convert' + type: Html + + + +... diff --git a/jamovi/retracted.u.yaml b/jamovi/retracted.u.yaml new file mode 100644 index 00000000..d8c7fcdc --- /dev/null +++ b/jamovi/retracted.u.yaml @@ -0,0 +1,17 @@ +title: Find Retracted Papers from DOI +name: retracted +jus: '3.0' +stage: 0 +compilerMode: aggressive +children: + - type: VariableSupplier + persistentItems: false + stretchFactor: 1 + children: + - type: TargetLayoutBox + label: Select DOI Variable + children: + - type: VariablesListBox + name: doi + maxItemCount: 1 + isTarget: true diff --git a/jamovi/tree.r.yaml b/jamovi/tree.r.yaml index 0e9b5247..b9045e34 100644 --- a/jamovi/tree.r.yaml +++ b/jamovi/tree.r.yaml @@ -42,56 +42,56 @@ items: - rpart.plot - # - name: plot1 - # title: Decision Tree Explore - # type: Image - # width: 600 - # height: 450 - # renderFun: .plot1 - # requiresData: true - # clearWith: - # - vars - # - facs - # - target - # - targetLevel - # - sty - # visible: (sty:explore) - # refs: explore + - name: plot1 + title: Decision Tree Explore + type: Image + width: 600 + height: 450 + renderFun: .plot1 + requiresData: true + clearWith: + - vars + - facs + - target + - targetLevel + - sty + visible: (sty:explore) + refs: explore - # - name: plot2 - # title: Decision Tree FFTrees - # type: Image - # width: 600 - # height: 450 - # renderFun: .plot2 - # requiresData: true - # clearWith: - # - vars - # - facs - # - target - # - targetLevel - # - sty - # visible: (sty:fftrees) - # refs: FFTrees + - name: plot2 + title: Decision Tree FFTrees + type: Image + width: 600 + height: 450 + renderFun: .plot2 + requiresData: true + clearWith: + - vars + - facs + - target + - targetLevel + - sty + visible: (sty:fftrees) + refs: FFTrees - # - name: plot3 - # title: Decision Tree rpart - # type: Image - # width: 600 - # height: 450 - # renderFun: .plot3 - # requiresData: true - # clearWith: - # - vars - # - facs - # - target - # - targetLevel - # - sty - # visible: (sty:rpart) - # refs: - # - rpart - # - rpart.plot + - name: plot3 + title: Decision Tree rpart + type: Image + width: 600 + height: 450 + renderFun: .plot3 + requiresData: true + clearWith: + - vars + - facs + - target + - targetLevel + - sty + visible: (sty:rpart) + refs: + - rpart + - rpart.plot ... diff --git a/man/crosstable.Rd b/man/crosstable.Rd index a30d36d8..9aeda7ee 100644 --- a/man/crosstable.Rd +++ b/man/crosstable.Rd @@ -4,7 +4,15 @@ \alias{crosstable} \title{Cross Tables} \usage{ -crosstable(data, vars, group, sty = "nejm", excl = TRUE) +crosstable( + data, + vars, + group, + sty = "nejm", + excl = TRUE, + cont = "mean", + pcat = "chisq" +) } \arguments{ \item{data}{The data as a data frame.} @@ -16,6 +24,10 @@ crosstable(data, vars, group, sty = "nejm", excl = TRUE) \item{sty}{.} \item{excl}{.} + +\item{cont}{.} + +\item{pcat}{.} } \value{ A results object containing: diff --git a/man/retracted.Rd b/man/retracted.Rd new file mode 100644 index 00000000..ac652f72 --- /dev/null +++ b/man/retracted.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/retracted.h.R +\name{retracted} +\alias{retracted} +\title{Find Retracted Papers from DOI} +\usage{ +retracted(data, doi) +} +\arguments{ +\item{data}{.} + +\item{doi}{.} +} +\value{ +A results object containing: +\tabular{llllll}{ +\code{results$text4} \tab \tab \tab \tab \tab a html \cr +} +} +\description{ +Find Retracted Papers from DOI +} diff --git a/man/retractedClass.Rd b/man/retractedClass.Rd new file mode 100644 index 00000000..db298d5d --- /dev/null +++ b/man/retractedClass.Rd @@ -0,0 +1,70 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/retracted.b.R +\name{retractedClass} +\alias{retractedClass} +\title{Find Retracted Papers from DOI} +\description{ +Find Retracted Papers from DOI + +Find Retracted Papers from DOI +} +\section{Super classes}{ +\code{\link[jmvcore:Analysis]{jmvcore::Analysis}} -> \code{\link[ClinicoPath:retractedBase]{ClinicoPath::retractedBase}} -> \code{retractedClass} +} +\section{Methods}{ +\subsection{Public methods}{ +\itemize{ +\item \href{#method-clone}{\code{retractedClass$clone()}} +} +} +\if{html}{ +\out{
Inherited methods} +\itemize{ +\item \out{}\href{../../jmvcore/html/Analysis.html#method-.createImage}{\code{jmvcore::Analysis$.createImage()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-.createImages}{\code{jmvcore::Analysis$.createImages()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-.createPlotObject}{\code{jmvcore::Analysis$.createPlotObject()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-.load}{\code{jmvcore::Analysis$.load()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-.render}{\code{jmvcore::Analysis$.render()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-.save}{\code{jmvcore::Analysis$.save()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-.savePart}{\code{jmvcore::Analysis$.savePart()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-.setCheckpoint}{\code{jmvcore::Analysis$.setCheckpoint()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-.setParent}{\code{jmvcore::Analysis$.setParent()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-.setReadDatasetHeaderSource}{\code{jmvcore::Analysis$.setReadDatasetHeaderSource()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-.setReadDatasetSource}{\code{jmvcore::Analysis$.setReadDatasetSource()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-.setResourcesPathSource}{\code{jmvcore::Analysis$.setResourcesPathSource()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-.setStatePathSource}{\code{jmvcore::Analysis$.setStatePathSource()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-addAddon}{\code{jmvcore::Analysis$addAddon()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-asProtoBuf}{\code{jmvcore::Analysis$asProtoBuf()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-asSource}{\code{jmvcore::Analysis$asSource()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-check}{\code{jmvcore::Analysis$check()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-init}{\code{jmvcore::Analysis$init()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-optionsChangedHandler}{\code{jmvcore::Analysis$optionsChangedHandler()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-postInit}{\code{jmvcore::Analysis$postInit()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-print}{\code{jmvcore::Analysis$print()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-readDataset}{\code{jmvcore::Analysis$readDataset()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-run}{\code{jmvcore::Analysis$run()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-serialize}{\code{jmvcore::Analysis$serialize()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-setError}{\code{jmvcore::Analysis$setError()}}\out{} +\item \out{}\href{../../jmvcore/html/Analysis.html#method-setStatus}{\code{jmvcore::Analysis$setStatus()}}\out{} +\item \out{}\href{../../ClinicoPath/html/retractedBase.html#method-initialize}{\code{ClinicoPath::retractedBase$initialize()}}\out{} +} +\out{
} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-clone}{}}} +\subsection{Method \code{clone()}}{ +The objects of this class are cloneable with this method. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{retractedClass$clone(deep = FALSE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{deep}}{Whether to make a deep clone.} +} +\if{html}{\out{
}} +} +} +} diff --git a/man/tree.Rd b/man/tree.Rd index 0bdb4d6b..028c7a9e 100644 --- a/man/tree.Rd +++ b/man/tree.Rd @@ -25,6 +25,9 @@ A results object containing: \code{results$todo} \tab \tab \tab \tab \tab a html \cr \code{results$text1} \tab \tab \tab \tab \tab a preformatted \cr \code{results$text2} \tab \tab \tab \tab \tab a preformatted \cr +\code{results$plot1} \tab \tab \tab \tab \tab an image \cr +\code{results$plot2} \tab \tab \tab \tab \tab an image \cr +\code{results$plot3} \tab \tab \tab \tab \tab an image \cr } } \description{ diff --git a/tododata/deneme.Rmd b/tododata/deneme.Rmd new file mode 100644 index 00000000..c84d75bf --- /dev/null +++ b/tododata/deneme.Rmd @@ -0,0 +1,16 @@ +--- +title: "R Notebook" +output: html_notebook +--- + +```{r, results='asis'} +library(arsenal) + +summary(tableby(sex ~ age + arm, data = mockstudy), + text = "html", + pfootnote = "html") + + + + +``` diff --git a/tododata/deneme.nb.html b/tododata/deneme.nb.html new file mode 100644 index 00000000..fd16cdd1 --- /dev/null +++ b/tododata/deneme.nb.html @@ -0,0 +1,1985 @@ + + + + + + + + + + + + + +R Notebook + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
library(arsenal)
+
+summary(tableby(sex ~ age + arm, data = mockstudy),
+        text = "html",
+        pfootnote = "html")
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +Male (N=916) + +Female (N=583) + +Total (N=1499) + +p value +
+Age in Years + + + + +0.0481 +
+   Mean (SD) + +60.455 (11.369) + +59.247 (11.722) + +59.985 (11.519) + +
+   Range + +19.000 - 88.000 + +22.000 - 88.000 + +19.000 - 88.000 + +
+Treatment Arm + + + + +0.1902 +
+   A: IFL + +277 (30.2%) + +151 (25.9%) + +428 (28.6%) + +
+   F: FOLFOX + +411 (44.9%) + +280 (48.0%) + +691 (46.1%) + +
+   G: IROX + +228 (24.9%) + +152 (26.1%) + +380 (25.4%) + +
+ + + + +
    +
  1. +Linear Model ANOVA +
  2. +
  3. +Pearson’s Chi-squared test +
  4. +
+ + +
LS0tCnRpdGxlOiAiUiBOb3RlYm9vayIKb3V0cHV0OiBodG1sX25vdGVib29rCi0tLQoKYGBge3IsIHJlc3VsdHM9J2FzaXMnfQpsaWJyYXJ5KGFyc2VuYWwpCgpzdW1tYXJ5KHRhYmxlYnkoc2V4IH4gYWdlICsgYXJtLCBkYXRhID0gbW9ja3N0dWR5KSwKICAgICAgICB0ZXh0ID0gImh0bWwiLAogICAgICAgIHBmb290bm90ZSA9ICJodG1sIikKCgoKCmBgYAo=
+ + + +
+ + + + + + + + + + + + + + + + diff --git a/tododata/todo.Rmd b/tododata/todo.Rmd index df4ab61e..f37956ae 100644 --- a/tododata/todo.Rmd +++ b/tododata/todo.Rmd @@ -924,6 +924,8 @@ system(command = gitCommand, intern = TRUE) # jmvtools::addAnalysis(name = "jjbarstats2", title = "jjbarstats2") +# jmvtools::addAnalysis(name = "retracted", title = "Find Retracted Papers from DOI") + ``` @@ -1560,6 +1562,30 @@ finalfit::finalfit(myformula, explanatory) -> tUni deneme <- readxl::read_xlsx(path = here::here("tododata", "histopathology-template2019-11-25.xlsx")) + +tabletangram <- + tangram::html5( + tangram::tangram( + "Death ~ LVI + PNI + Age", deneme, + transform=tangram::hmisc, + id = "tbl3", + digits = 1, + test = TRUE, + include_p = TRUE + ), + fragment = TRUE, + style = "nejm", + caption = paste0( + "Cross Table for Dependent " + ), + id = "tbl3") + +tabletangram + +``` + + +```{r table tangram} table3 <- tangram::html5( tangram::tangram( @@ -1667,6 +1693,21 @@ plot <- ## arsenal +```{r} +library(arsenal) + +summary(tableby(sex ~ age + arm, data = mockstudy), + text = "html", + pfootnote = "html") + + + + +``` + + + + ```{r arsenal, results='asis'} deneme <- readxl::read_xlsx(path = here::here("tododata", "histopathology-template2019-11-25.xlsx")) @@ -1683,10 +1724,14 @@ tablearsenal <- tab1 tablearsenal2 <- summary(tablearsenal, text = 'html', - pfootnote = TRUE) + pfootnote = 'html') + + +# gregexpr(pattern = "^\n.*$", text = tablearsenal2, perl = TRUE) + +tablearsenal2 <- capture.output(tablearsenal2) -gregexpr(pattern = "^\n.*$", text = tablearsenal2, perl = TRUE) tablearsenal3 <- @@ -3351,3 +3396,105 @@ print(resTogether, quote = FALSE) - github page: https://github.com/kaz-yos/tableone + +```{r} +doi_list <- c( + "10.4103/IJPM.IJPM_85_17", + "10.5146/tjpath.2017.01404", + "10.1038/modpathol.2017.106", + "10.1038/modpathol.2017.60", + "10.1097/PAS.0000000000000863", + "10.1097/PHM.0000000000000727", + "10.1038/modpathol.2016.223", + "10.1097/PAS.0000000000000782", + "10.1007/s00428-016-2014-x", + "10.1038/modpathol.2016.125", + "10.1111/cup.12790", + "10.1038/modpathol.2016.174", + "10.1016/j.ijscr.2016.04.003", + "10.1038/modpathol.2016.124", + "10.1038/modpathol.2016.105", + "10.1016/j.anndiagpath.2016.04.002", + "10.1097/PAI.0000000000000353", + "10.1016/j.jmoldx.2015.11.006", + "10.1245/s10434-015-4861-0", + "10.1097/MEG.0000000000000463", + "10.4103/0970-9371.160549", + "10.1038/modpathol.2015.61", + "10.1245/s10434-015-4499-y", + "10.1097/PAS.0000000000000408", + "10.1016/j.ijrobp.2014.11.004", + "10.1053/j.semdp.2014.08.009", + "10.1038/modpathol.2014.156", + "10.18632/oncotarget.1682", + "10.1371/journal.pone.0088525", + "10.1097/PAS.0000000000000165", + "10.1309/AJCP0FKDP7ENVKEV", + "10.1007/s12022-013-9295-2", + "10.1007/s11102-013-0551-8", + "10.1007/s12022-013-9275-6", + "10.1016/j.ajg.2013.08.008", + "10.1631/jzus.B1300016", + "10.1111/cyt.12093", + "10.2214/AJR.12.9139", + "10.3109/0886022X.2012.745115", + "10.1111/cyt.12021", + "10.1053/j.semdp.2012.08.010", + "10.1097/PAS.0b013e31826399d8", + "10.5146/tjpath.2012.01125", + "10.1016/j.urolonc.2012.06.014", + "10.1097/COC.0b013e3182467efa", + "10.1038/modpathol.2012.37", + "10.1007/s00701-011-1241-9", + "10.3171/2011.5.SPINE10303", + "10.1007/s00296-011-1866-2", + "10.1097/MPA.0b013e318201c935", + "10.1016/j.jaapos.2010.01.013", + "10.1007/s00701-010-0677-7", + "10.1097/PGP.0b013e3181b70176", + "10.1155/2018/1072403", + "10.1155/2013/157456", + "10.1155/2019/4301528", + "10.1155/2014/943162", + "10.1155/2017/4583434", + "10.3892/mmr.2017.6299", + "10.1002/job.1787", + "10.1111/j.1365-2044.2012.07128.x" +) + +retracted_list <- + retractcheck::retractcheck( + dois = doi_list, + database = "rw", + return = "all" + ) + + +(table_retracted_list <- kableExtra::kable( + retracted_list, + format = "html" + ) +) + +``` + +```{r} + info_list <- + RefManageR::GetBibEntryWithDOI(doi = doi_list) + + + table_info_list <- kableExtra::kable( + info_list, + format = "html" + ) +``` + +```{r} + +ids <- rcrossref::id_converter(x = doi_list) + +ids[["records"]] + +``` + + diff --git a/vignettes/module_development_jamovi.Rmd b/vignettes/module_development_jamovi.Rmd index c380472c..5db49433 100644 --- a/vignettes/module_development_jamovi.Rmd +++ b/vignettes/module_development_jamovi.Rmd @@ -138,6 +138,45 @@ No need to change. Auto-updated and overwritten. #### `function.b.R` +##### Write Formula + + +https://cran.r-project.org/web/packages/jmv/vignettes/new-syntax.html + +```r +jmv::ANOVA(formula = len ~ supp * dose, ToothGrowth) +``` + +```r +jmv::ANOVA(ToothGrowth, len, vars(supp, dose)) +``` + +```r +jmv::ANOVA(..., emMeans = ~ supp + dose:supp) +``` + +```r +jmv::ANOVA(ToothGrowth, 'len', c('supp', 'dose')) +``` + + +> In this case, jmv will look for variables in ToothGrowth called 'dep' or 'factors'. This is tidy evaluation. To instruct jmv to use the contents of it's arguments, rather than the symbol name, prefix them with the !! signifier. For example: + + +```r +dep <- 'len' +factors <- c('supp', 'dose') + +jmv::ANOVA(ToothGrowth, !!dep, !!factors) +``` + + + + + + + + ##### Warning, Error Messages