# This file is automatically generated, you probably don't want to edit this
jjcorrmatOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
"jjcorrmatOptions",
inherit = jmvcore::Options,
public = list(
initialize = function(
dep = NULL,
grvar = NULL,
typestatistics = "parametric", ...) {
super$initialize(
package="ClinicoPath",
name="jjcorrmat",
requiresData=TRUE,
...)
private$..dep <- jmvcore::OptionVariables$new(
"dep",
dep,
suggested=list(
"continuous"),
permitted=list(
"numeric"))
private$..grvar <- jmvcore::OptionVariable$new(
"grvar",
grvar,
suggested=list(
"ordinal",
"nominal"),
permitted=list(
"factor"))
private$..typestatistics <- jmvcore::OptionList$new(
"typestatistics",
typestatistics,
options=list(
"parametric",
"nonparametric",
"robust",
"bayes"),
default="parametric")
self$.addOption(private$..dep)
self$.addOption(private$..grvar)
self$.addOption(private$..typestatistics)
}),
active = list(
dep = function() private$..dep$value,
grvar = function() private$..grvar$value,
typestatistics = function() private$..typestatistics$value),
private = list(
..dep = NA,
..grvar = NA,
..typestatistics = NA)
)
jjcorrmatResults <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
"jjcorrmatResults",
inherit = jmvcore::Group,
active = list(
todo = function() private$.items[["todo"]],
plot2 = function() private$.items[["plot2"]],
plot = function() private$.items[["plot"]]),
private = list(),
public=list(
initialize=function(options) {
super$initialize(
options=options,
name="",
title="Correlation Matrix",
refs=list(
"ggplot2",
"ggstatsplot",
"ClinicoPathJamoviModule"),
clearWith=list(
"dep",
"grvar",
"excl",
"originaltheme",
"typestatistics"))
self$add(jmvcore::Html$new(
options=options,
name="todo",
title="To Do"))
self$add(jmvcore::Image$new(
options=options,
name="plot2",
title="Chart",
width=800,
height=600,
renderFun=".plot2",
requiresData=TRUE,
visible="(grvar)"))
self$add(jmvcore::Image$new(
options=options,
name="plot",
title="Chart",
width=800,
height=600,
renderFun=".plot",
requiresData=TRUE))}))
jjcorrmatBase <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
"jjcorrmatBase",
inherit = jmvcore::Analysis,
public = list(
initialize = function(options, data=NULL, datasetId="", analysisId="", revision=0) {
super$initialize(
package = "ClinicoPath",
name = "jjcorrmat",
version = c(1,0,0),
options = options,
results = jjcorrmatResults$new(options=options),
data = data,
datasetId = datasetId,
analysisId = analysisId,
revision = revision,
pause = NULL,
completeWhenFilled = FALSE,
requiresMissings = FALSE,
weightsSupport = 'auto')
}))
#' Correlation Matrix
#'
#'
#'
#' @examples
#' \donttest{
#' # example will be added
#'}
#' @param data The data as a data frame.
#' @param dep .
#' @param grvar .
#' @param typestatistics .
#' @return A results object containing:
#' \tabular{llllll}{
#' \code{results$todo} \tab \tab \tab \tab \tab a html \cr
#' \code{results$plot2} \tab \tab \tab \tab \tab an image \cr
#' \code{results$plot} \tab \tab \tab \tab \tab an image \cr
#' }
#'
#' @export
jjcorrmat <- function(
data,
dep,
grvar,
typestatistics = "parametric") {
if ( ! requireNamespace("jmvcore", quietly=TRUE))
stop("jjcorrmat requires jmvcore to be installed (restart may be required)")
if ( ! missing(dep)) dep <- jmvcore::resolveQuo(jmvcore::enquo(dep))
if ( ! missing(grvar)) grvar <- jmvcore::resolveQuo(jmvcore::enquo(grvar))
if (missing(data))
data <- jmvcore::marshalData(
parent.frame(),
`if`( ! missing(dep), dep, NULL),
`if`( ! missing(grvar), grvar, NULL))
for (v in grvar) if (v %in% names(data)) data[[v]] <- as.factor(data[[v]])
options <- jjcorrmatOptions$new(
dep = dep,
grvar = grvar,
typestatistics = typestatistics)
analysis <- jjcorrmatClass$new(
options = options,
data = data)
analysis$run()
analysis$results
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.