R/jamovicorrelation.h.R

Defines functions jamovicorrelation

Documented in jamovicorrelation

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

jamovicorrelationOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
    "jamovicorrelationOptions",
    inherit = jmvcore::Options,
    public = list(
        initialize = function(
            switch = "from_raw",
            x = NULL,
            y = NULL,
            r = " ",
            n = " ",
            x_variable_name = "X variable",
            y_variable_name = "Y variable",
            conf_level = 95,
            show_details = FALSE,
            do_regression = FALSE,
            show_line = FALSE,
            show_line_CI = FALSE,
            show_residuals = FALSE,
            show_PI = FALSE,
            show_mean_lines = FALSE,
            show_r = FALSE,
            plot_as_z = FALSE,
            predict_from_x = " ",
            evaluate_hypotheses = FALSE,
            null_value = "0",
            null_boundary = "0",
            alpha = 0.05,
            null_color = "#A40122",
            es_plot_width = "300",
            es_plot_height = "400",
            sp_plot_width = "650",
            sp_plot_height = "650",
            ymin = "-1",
            ymax = "1",
            ybreaks = "auto",
            ylab = "auto",
            xlab = "auto",
            axis.text.y = "14",
            axis.title.y = "15",
            axis.text.x = "14",
            axis.title.x = "15",
            error_layout = "none",
            sp_ymin = "auto",
            sp_ymax = "auto",
            sp_ybreaks = "auto",
            sp_xmin = "auto",
            sp_xmax = "auto",
            sp_xbreaks = "auto",
            sp_ylab = "auto",
            sp_xlab = "auto",
            sp_axis.text.y = "14",
            sp_axis.title.y = "15",
            sp_axis.text.x = "14",
            sp_axis.title.x = "15",
            shape_summary = "circle filled",
            color_summary = "#008DF9",
            fill_summary = "#008DF9",
            size_summary = "4",
            alpha_summary = "1",
            linetype_summary = "solid",
            color_interval = "black",
            size_interval = "3",
            alpha_interval = "1",
            alpha_error = "1",
            fill_error = "gray75",
            sp_shape_raw_reference = "circle filled",
            sp_color_raw_reference = "black",
            sp_fill_raw_reference = "#008DF9",
            sp_size_raw_reference = "3",
            sp_alpha_raw_reference = ".25",
            sp_linetype_summary_reference = "solid",
            sp_color_summary_reference = "#008DF9",
            sp_size_summary_reference = "3",
            sp_alpha_summary_reference = ".25",
            sp_linetype_PI_reference = "dotted",
            sp_color_PI_reference = "#E20134",
            sp_size_PI_reference = "2",
            sp_alpha_PI_reference = "1",
            sp_linetype_residual_reference = "solid",
            sp_color_residual_reference = "#E20134",
            sp_size_residual_reference = "1",
            sp_alpha_residual_reference = "1",
            sp_prediction_label = "5",
            sp_prediction_color = "#E20134",
            sp_linetype_CI = "solid",
            sp_color_CI = "#008DF9",
            sp_size_CI = "4",
            sp_alpha_CI = "1",
            sp_linetype_ref = "dotted",
            sp_color_ref = "gray60",
            sp_size_ref = "1",
            sp_alpha_ref = "1",
            sp_linetype_PI = "solid",
            sp_color_PI = "#E20134",
            sp_size_PI = "2",
            sp_alpha_PI = "1", ...) {

            super$initialize(
                package="esci",
                name="jamovicorrelation",
                requiresData=TRUE,
                ...)

            private$..switch <- jmvcore::OptionList$new(
                "switch",
                switch,
                default="from_raw",
                options=list(
                    "from_raw",
                    "from_summary"))
            private$..x <- jmvcore::OptionVariable$new(
                "x",
                x,
                suggested=list(
                    "continuous"),
                permitted=list(
                    "numeric"))
            private$..y <- jmvcore::OptionVariable$new(
                "y",
                y,
                suggested=list(
                    "continuous"),
                permitted=list(
                    "numeric"))
            private$..r <- jmvcore::OptionString$new(
                "r",
                r,
                default=" ")
            private$..n <- jmvcore::OptionString$new(
                "n",
                n,
                default=" ")
            private$..x_variable_name <- jmvcore::OptionString$new(
                "x_variable_name",
                x_variable_name,
                default="X variable")
            private$..y_variable_name <- jmvcore::OptionString$new(
                "y_variable_name",
                y_variable_name,
                default="Y variable")
            private$..conf_level <- jmvcore::OptionNumber$new(
                "conf_level",
                conf_level,
                default=95)
            private$..show_details <- jmvcore::OptionBool$new(
                "show_details",
                show_details,
                default=FALSE)
            private$..do_regression <- jmvcore::OptionBool$new(
                "do_regression",
                do_regression,
                default=FALSE)
            private$..show_line <- jmvcore::OptionBool$new(
                "show_line",
                show_line,
                default=FALSE)
            private$..show_line_CI <- jmvcore::OptionBool$new(
                "show_line_CI",
                show_line_CI,
                default=FALSE)
            private$..show_residuals <- jmvcore::OptionBool$new(
                "show_residuals",
                show_residuals,
                default=FALSE)
            private$..show_PI <- jmvcore::OptionBool$new(
                "show_PI",
                show_PI,
                default=FALSE)
            private$..show_mean_lines <- jmvcore::OptionBool$new(
                "show_mean_lines",
                show_mean_lines,
                default=FALSE)
            private$..show_r <- jmvcore::OptionBool$new(
                "show_r",
                show_r,
                default=FALSE)
            private$..plot_as_z <- jmvcore::OptionBool$new(
                "plot_as_z",
                plot_as_z,
                default=FALSE)
            private$..predict_from_x <- jmvcore::OptionString$new(
                "predict_from_x",
                predict_from_x,
                default=" ")
            private$..evaluate_hypotheses <- jmvcore::OptionBool$new(
                "evaluate_hypotheses",
                evaluate_hypotheses,
                default=FALSE)
            private$..null_value <- jmvcore::OptionString$new(
                "null_value",
                null_value,
                default="0")
            private$..null_boundary <- jmvcore::OptionString$new(
                "null_boundary",
                null_boundary,
                default="0")
            private$..alpha <- jmvcore::OptionNumber$new(
                "alpha",
                alpha,
                default=0.05)
            private$..null_color <- jmvcore::OptionList$new(
                "null_color",
                null_color,
                default="#A40122",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..es_plot_width <- jmvcore::OptionString$new(
                "es_plot_width",
                es_plot_width,
                default="300")
            private$..es_plot_height <- jmvcore::OptionString$new(
                "es_plot_height",
                es_plot_height,
                default="400")
            private$..sp_plot_width <- jmvcore::OptionString$new(
                "sp_plot_width",
                sp_plot_width,
                default="650")
            private$..sp_plot_height <- jmvcore::OptionString$new(
                "sp_plot_height",
                sp_plot_height,
                default="650")
            private$..ymin <- jmvcore::OptionString$new(
                "ymin",
                ymin,
                default="-1")
            private$..ymax <- jmvcore::OptionString$new(
                "ymax",
                ymax,
                default="1")
            private$..ybreaks <- jmvcore::OptionString$new(
                "ybreaks",
                ybreaks,
                default="auto")
            private$..ylab <- jmvcore::OptionString$new(
                "ylab",
                ylab,
                default="auto")
            private$..xlab <- jmvcore::OptionString$new(
                "xlab",
                xlab,
                default="auto")
            private$..axis.text.y <- jmvcore::OptionString$new(
                "axis.text.y",
                axis.text.y,
                default="14")
            private$..axis.title.y <- jmvcore::OptionString$new(
                "axis.title.y",
                axis.title.y,
                default="15")
            private$..axis.text.x <- jmvcore::OptionString$new(
                "axis.text.x",
                axis.text.x,
                default="14")
            private$..axis.title.x <- jmvcore::OptionString$new(
                "axis.title.x",
                axis.title.x,
                default="15")
            private$..error_layout <- jmvcore::OptionList$new(
                "error_layout",
                error_layout,
                default="none",
                options=list(
                    "halfeye",
                    "eye",
                    "none"))
            private$..sp_ymin <- jmvcore::OptionString$new(
                "sp_ymin",
                sp_ymin,
                default="auto")
            private$..sp_ymax <- jmvcore::OptionString$new(
                "sp_ymax",
                sp_ymax,
                default="auto")
            private$..sp_ybreaks <- jmvcore::OptionString$new(
                "sp_ybreaks",
                sp_ybreaks,
                default="auto")
            private$..sp_xmin <- jmvcore::OptionString$new(
                "sp_xmin",
                sp_xmin,
                default="auto")
            private$..sp_xmax <- jmvcore::OptionString$new(
                "sp_xmax",
                sp_xmax,
                default="auto")
            private$..sp_xbreaks <- jmvcore::OptionString$new(
                "sp_xbreaks",
                sp_xbreaks,
                default="auto")
            private$..sp_ylab <- jmvcore::OptionString$new(
                "sp_ylab",
                sp_ylab,
                default="auto")
            private$..sp_xlab <- jmvcore::OptionString$new(
                "sp_xlab",
                sp_xlab,
                default="auto")
            private$..sp_axis.text.y <- jmvcore::OptionString$new(
                "sp_axis.text.y",
                sp_axis.text.y,
                default="14")
            private$..sp_axis.title.y <- jmvcore::OptionString$new(
                "sp_axis.title.y",
                sp_axis.title.y,
                default="15")
            private$..sp_axis.text.x <- jmvcore::OptionString$new(
                "sp_axis.text.x",
                sp_axis.text.x,
                default="14")
            private$..sp_axis.title.x <- jmvcore::OptionString$new(
                "sp_axis.title.x",
                sp_axis.title.x,
                default="15")
            private$..shape_summary <- jmvcore::OptionList$new(
                "shape_summary",
                shape_summary,
                default="circle filled",
                options=list(
                    "circle filled",
                    "square filled",
                    "triangle filled",
                    "diamond filled"))
            private$..color_summary <- jmvcore::OptionList$new(
                "color_summary",
                color_summary,
                default="#008DF9",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..fill_summary <- jmvcore::OptionList$new(
                "fill_summary",
                fill_summary,
                default="#008DF9",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..size_summary <- jmvcore::OptionList$new(
                "size_summary",
                size_summary,
                default="4",
                options=list(
                    "1",
                    "2",
                    "3",
                    "4",
                    "5",
                    "6"))
            private$..alpha_summary <- jmvcore::OptionList$new(
                "alpha_summary",
                alpha_summary,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..linetype_summary <- jmvcore::OptionList$new(
                "linetype_summary",
                linetype_summary,
                default="solid",
                options=list(
                    "solid",
                    "dotted",
                    "dotdash",
                    "dashed",
                    "blank"))
            private$..color_interval <- jmvcore::OptionList$new(
                "color_interval",
                color_interval,
                default="black",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..size_interval <- jmvcore::OptionList$new(
                "size_interval",
                size_interval,
                default="3",
                options=list(
                    "1",
                    "2",
                    "3",
                    "4",
                    "5",
                    "6",
                    "7",
                    "8"))
            private$..alpha_interval <- jmvcore::OptionList$new(
                "alpha_interval",
                alpha_interval,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..alpha_error <- jmvcore::OptionList$new(
                "alpha_error",
                alpha_error,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..fill_error <- jmvcore::OptionList$new(
                "fill_error",
                fill_error,
                default="gray75",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..sp_shape_raw_reference <- jmvcore::OptionList$new(
                "sp_shape_raw_reference",
                sp_shape_raw_reference,
                default="circle filled",
                options=list(
                    "circle filled",
                    "square filled",
                    "triangle filled",
                    "diamond filled"))
            private$..sp_color_raw_reference <- jmvcore::OptionList$new(
                "sp_color_raw_reference",
                sp_color_raw_reference,
                default="black",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..sp_fill_raw_reference <- jmvcore::OptionList$new(
                "sp_fill_raw_reference",
                sp_fill_raw_reference,
                default="#008DF9",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..sp_size_raw_reference <- jmvcore::OptionList$new(
                "sp_size_raw_reference",
                sp_size_raw_reference,
                default="3",
                options=list(
                    "1",
                    "2",
                    "3",
                    "4",
                    "5",
                    "6"))
            private$..sp_alpha_raw_reference <- jmvcore::OptionList$new(
                "sp_alpha_raw_reference",
                sp_alpha_raw_reference,
                default=".25",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..sp_linetype_summary_reference <- jmvcore::OptionList$new(
                "sp_linetype_summary_reference",
                sp_linetype_summary_reference,
                default="solid",
                options=list(
                    "solid",
                    "dotted",
                    "dotdash",
                    "dashed",
                    "blank"))
            private$..sp_color_summary_reference <- jmvcore::OptionList$new(
                "sp_color_summary_reference",
                sp_color_summary_reference,
                default="#008DF9",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..sp_size_summary_reference <- jmvcore::OptionList$new(
                "sp_size_summary_reference",
                sp_size_summary_reference,
                default="3",
                options=list(
                    "1",
                    "2",
                    "3",
                    "4",
                    "5",
                    "6"))
            private$..sp_alpha_summary_reference <- jmvcore::OptionList$new(
                "sp_alpha_summary_reference",
                sp_alpha_summary_reference,
                default=".25",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..sp_linetype_PI_reference <- jmvcore::OptionList$new(
                "sp_linetype_PI_reference",
                sp_linetype_PI_reference,
                default="dotted",
                options=list(
                    "solid",
                    "dotted",
                    "dotdash",
                    "dashed",
                    "blank"))
            private$..sp_color_PI_reference <- jmvcore::OptionList$new(
                "sp_color_PI_reference",
                sp_color_PI_reference,
                default="#E20134",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..sp_size_PI_reference <- jmvcore::OptionList$new(
                "sp_size_PI_reference",
                sp_size_PI_reference,
                default="2",
                options=list(
                    "1",
                    "2",
                    "3",
                    "4",
                    "5",
                    "6"))
            private$..sp_alpha_PI_reference <- jmvcore::OptionList$new(
                "sp_alpha_PI_reference",
                sp_alpha_PI_reference,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..sp_linetype_residual_reference <- jmvcore::OptionList$new(
                "sp_linetype_residual_reference",
                sp_linetype_residual_reference,
                default="solid",
                options=list(
                    "solid",
                    "dotted",
                    "dotdash",
                    "dashed",
                    "blank"))
            private$..sp_color_residual_reference <- jmvcore::OptionList$new(
                "sp_color_residual_reference",
                sp_color_residual_reference,
                default="#E20134",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..sp_size_residual_reference <- jmvcore::OptionList$new(
                "sp_size_residual_reference",
                sp_size_residual_reference,
                default="1",
                options=list(
                    "1",
                    "2",
                    "3",
                    "4",
                    "5",
                    "6"))
            private$..sp_alpha_residual_reference <- jmvcore::OptionList$new(
                "sp_alpha_residual_reference",
                sp_alpha_residual_reference,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..sp_prediction_label <- jmvcore::OptionList$new(
                "sp_prediction_label",
                sp_prediction_label,
                default="5",
                options=list(
                    "3",
                    "4",
                    "5",
                    "6",
                    "7",
                    "8"))
            private$..sp_prediction_color <- jmvcore::OptionList$new(
                "sp_prediction_color",
                sp_prediction_color,
                default="#E20134",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..sp_linetype_CI <- jmvcore::OptionList$new(
                "sp_linetype_CI",
                sp_linetype_CI,
                default="solid",
                options=list(
                    "solid",
                    "dotted",
                    "dotdash",
                    "dashed",
                    "blank"))
            private$..sp_color_CI <- jmvcore::OptionList$new(
                "sp_color_CI",
                sp_color_CI,
                default="#008DF9",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..sp_size_CI <- jmvcore::OptionList$new(
                "sp_size_CI",
                sp_size_CI,
                default="4",
                options=list(
                    "1",
                    "2",
                    "3",
                    "4",
                    "5",
                    "6"))
            private$..sp_alpha_CI <- jmvcore::OptionList$new(
                "sp_alpha_CI",
                sp_alpha_CI,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..sp_linetype_ref <- jmvcore::OptionList$new(
                "sp_linetype_ref",
                sp_linetype_ref,
                default="dotted",
                options=list(
                    "solid",
                    "dotted",
                    "dotdash",
                    "dashed",
                    "blank"))
            private$..sp_color_ref <- jmvcore::OptionList$new(
                "sp_color_ref",
                sp_color_ref,
                default="gray60",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..sp_size_ref <- jmvcore::OptionList$new(
                "sp_size_ref",
                sp_size_ref,
                default="1",
                options=list(
                    "1",
                    "2",
                    "3",
                    "4",
                    "5",
                    "6"))
            private$..sp_alpha_ref <- jmvcore::OptionList$new(
                "sp_alpha_ref",
                sp_alpha_ref,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))
            private$..sp_linetype_PI <- jmvcore::OptionList$new(
                "sp_linetype_PI",
                sp_linetype_PI,
                default="solid",
                options=list(
                    "solid",
                    "dotted",
                    "dotdash",
                    "dashed",
                    "blank"))
            private$..sp_color_PI <- jmvcore::OptionList$new(
                "sp_color_PI",
                sp_color_PI,
                default="#E20134",
                options=list(
                    "black",
                    "#00C2F9",
                    "#008DF9",
                    "#009F81",
                    "#FF5AAF",
                    "#9F0162",
                    "#A40122",
                    "#00FCCF",
                    "#FF6E3A",
                    "#FFB2FD",
                    "#8400CD",
                    "#E20134",
                    "#FFC33B",
                    "white",
                    "NA",
                    "NA",
                    "gray0",
                    "gray5",
                    "gray10",
                    "gray15",
                    "gray20",
                    "gray25",
                    "gray30",
                    "gray35",
                    "gray40",
                    "gray45",
                    "gray50",
                    "gray55",
                    "gray60",
                    "gray65",
                    "gray70",
                    "gray75",
                    "gray80",
                    "gray85",
                    "gray90",
                    "gray95",
                    "gray100"))
            private$..sp_size_PI <- jmvcore::OptionList$new(
                "sp_size_PI",
                sp_size_PI,
                default="2",
                options=list(
                    "1",
                    "2",
                    "3",
                    "4",
                    "5",
                    "6"))
            private$..sp_alpha_PI <- jmvcore::OptionList$new(
                "sp_alpha_PI",
                sp_alpha_PI,
                default="1",
                options=list(
                    "1",
                    ".75",
                    ".5",
                    ".25",
                    ".20",
                    ".15",
                    ".10",
                    ".05",
                    "0"))

            self$.addOption(private$..switch)
            self$.addOption(private$..x)
            self$.addOption(private$..y)
            self$.addOption(private$..r)
            self$.addOption(private$..n)
            self$.addOption(private$..x_variable_name)
            self$.addOption(private$..y_variable_name)
            self$.addOption(private$..conf_level)
            self$.addOption(private$..show_details)
            self$.addOption(private$..do_regression)
            self$.addOption(private$..show_line)
            self$.addOption(private$..show_line_CI)
            self$.addOption(private$..show_residuals)
            self$.addOption(private$..show_PI)
            self$.addOption(private$..show_mean_lines)
            self$.addOption(private$..show_r)
            self$.addOption(private$..plot_as_z)
            self$.addOption(private$..predict_from_x)
            self$.addOption(private$..evaluate_hypotheses)
            self$.addOption(private$..null_value)
            self$.addOption(private$..null_boundary)
            self$.addOption(private$..alpha)
            self$.addOption(private$..null_color)
            self$.addOption(private$..es_plot_width)
            self$.addOption(private$..es_plot_height)
            self$.addOption(private$..sp_plot_width)
            self$.addOption(private$..sp_plot_height)
            self$.addOption(private$..ymin)
            self$.addOption(private$..ymax)
            self$.addOption(private$..ybreaks)
            self$.addOption(private$..ylab)
            self$.addOption(private$..xlab)
            self$.addOption(private$..axis.text.y)
            self$.addOption(private$..axis.title.y)
            self$.addOption(private$..axis.text.x)
            self$.addOption(private$..axis.title.x)
            self$.addOption(private$..error_layout)
            self$.addOption(private$..sp_ymin)
            self$.addOption(private$..sp_ymax)
            self$.addOption(private$..sp_ybreaks)
            self$.addOption(private$..sp_xmin)
            self$.addOption(private$..sp_xmax)
            self$.addOption(private$..sp_xbreaks)
            self$.addOption(private$..sp_ylab)
            self$.addOption(private$..sp_xlab)
            self$.addOption(private$..sp_axis.text.y)
            self$.addOption(private$..sp_axis.title.y)
            self$.addOption(private$..sp_axis.text.x)
            self$.addOption(private$..sp_axis.title.x)
            self$.addOption(private$..shape_summary)
            self$.addOption(private$..color_summary)
            self$.addOption(private$..fill_summary)
            self$.addOption(private$..size_summary)
            self$.addOption(private$..alpha_summary)
            self$.addOption(private$..linetype_summary)
            self$.addOption(private$..color_interval)
            self$.addOption(private$..size_interval)
            self$.addOption(private$..alpha_interval)
            self$.addOption(private$..alpha_error)
            self$.addOption(private$..fill_error)
            self$.addOption(private$..sp_shape_raw_reference)
            self$.addOption(private$..sp_color_raw_reference)
            self$.addOption(private$..sp_fill_raw_reference)
            self$.addOption(private$..sp_size_raw_reference)
            self$.addOption(private$..sp_alpha_raw_reference)
            self$.addOption(private$..sp_linetype_summary_reference)
            self$.addOption(private$..sp_color_summary_reference)
            self$.addOption(private$..sp_size_summary_reference)
            self$.addOption(private$..sp_alpha_summary_reference)
            self$.addOption(private$..sp_linetype_PI_reference)
            self$.addOption(private$..sp_color_PI_reference)
            self$.addOption(private$..sp_size_PI_reference)
            self$.addOption(private$..sp_alpha_PI_reference)
            self$.addOption(private$..sp_linetype_residual_reference)
            self$.addOption(private$..sp_color_residual_reference)
            self$.addOption(private$..sp_size_residual_reference)
            self$.addOption(private$..sp_alpha_residual_reference)
            self$.addOption(private$..sp_prediction_label)
            self$.addOption(private$..sp_prediction_color)
            self$.addOption(private$..sp_linetype_CI)
            self$.addOption(private$..sp_color_CI)
            self$.addOption(private$..sp_size_CI)
            self$.addOption(private$..sp_alpha_CI)
            self$.addOption(private$..sp_linetype_ref)
            self$.addOption(private$..sp_color_ref)
            self$.addOption(private$..sp_size_ref)
            self$.addOption(private$..sp_alpha_ref)
            self$.addOption(private$..sp_linetype_PI)
            self$.addOption(private$..sp_color_PI)
            self$.addOption(private$..sp_size_PI)
            self$.addOption(private$..sp_alpha_PI)
        }),
    active = list(
        switch = function() private$..switch$value,
        x = function() private$..x$value,
        y = function() private$..y$value,
        r = function() private$..r$value,
        n = function() private$..n$value,
        x_variable_name = function() private$..x_variable_name$value,
        y_variable_name = function() private$..y_variable_name$value,
        conf_level = function() private$..conf_level$value,
        show_details = function() private$..show_details$value,
        do_regression = function() private$..do_regression$value,
        show_line = function() private$..show_line$value,
        show_line_CI = function() private$..show_line_CI$value,
        show_residuals = function() private$..show_residuals$value,
        show_PI = function() private$..show_PI$value,
        show_mean_lines = function() private$..show_mean_lines$value,
        show_r = function() private$..show_r$value,
        plot_as_z = function() private$..plot_as_z$value,
        predict_from_x = function() private$..predict_from_x$value,
        evaluate_hypotheses = function() private$..evaluate_hypotheses$value,
        null_value = function() private$..null_value$value,
        null_boundary = function() private$..null_boundary$value,
        alpha = function() private$..alpha$value,
        null_color = function() private$..null_color$value,
        es_plot_width = function() private$..es_plot_width$value,
        es_plot_height = function() private$..es_plot_height$value,
        sp_plot_width = function() private$..sp_plot_width$value,
        sp_plot_height = function() private$..sp_plot_height$value,
        ymin = function() private$..ymin$value,
        ymax = function() private$..ymax$value,
        ybreaks = function() private$..ybreaks$value,
        ylab = function() private$..ylab$value,
        xlab = function() private$..xlab$value,
        axis.text.y = function() private$..axis.text.y$value,
        axis.title.y = function() private$..axis.title.y$value,
        axis.text.x = function() private$..axis.text.x$value,
        axis.title.x = function() private$..axis.title.x$value,
        error_layout = function() private$..error_layout$value,
        sp_ymin = function() private$..sp_ymin$value,
        sp_ymax = function() private$..sp_ymax$value,
        sp_ybreaks = function() private$..sp_ybreaks$value,
        sp_xmin = function() private$..sp_xmin$value,
        sp_xmax = function() private$..sp_xmax$value,
        sp_xbreaks = function() private$..sp_xbreaks$value,
        sp_ylab = function() private$..sp_ylab$value,
        sp_xlab = function() private$..sp_xlab$value,
        sp_axis.text.y = function() private$..sp_axis.text.y$value,
        sp_axis.title.y = function() private$..sp_axis.title.y$value,
        sp_axis.text.x = function() private$..sp_axis.text.x$value,
        sp_axis.title.x = function() private$..sp_axis.title.x$value,
        shape_summary = function() private$..shape_summary$value,
        color_summary = function() private$..color_summary$value,
        fill_summary = function() private$..fill_summary$value,
        size_summary = function() private$..size_summary$value,
        alpha_summary = function() private$..alpha_summary$value,
        linetype_summary = function() private$..linetype_summary$value,
        color_interval = function() private$..color_interval$value,
        size_interval = function() private$..size_interval$value,
        alpha_interval = function() private$..alpha_interval$value,
        alpha_error = function() private$..alpha_error$value,
        fill_error = function() private$..fill_error$value,
        sp_shape_raw_reference = function() private$..sp_shape_raw_reference$value,
        sp_color_raw_reference = function() private$..sp_color_raw_reference$value,
        sp_fill_raw_reference = function() private$..sp_fill_raw_reference$value,
        sp_size_raw_reference = function() private$..sp_size_raw_reference$value,
        sp_alpha_raw_reference = function() private$..sp_alpha_raw_reference$value,
        sp_linetype_summary_reference = function() private$..sp_linetype_summary_reference$value,
        sp_color_summary_reference = function() private$..sp_color_summary_reference$value,
        sp_size_summary_reference = function() private$..sp_size_summary_reference$value,
        sp_alpha_summary_reference = function() private$..sp_alpha_summary_reference$value,
        sp_linetype_PI_reference = function() private$..sp_linetype_PI_reference$value,
        sp_color_PI_reference = function() private$..sp_color_PI_reference$value,
        sp_size_PI_reference = function() private$..sp_size_PI_reference$value,
        sp_alpha_PI_reference = function() private$..sp_alpha_PI_reference$value,
        sp_linetype_residual_reference = function() private$..sp_linetype_residual_reference$value,
        sp_color_residual_reference = function() private$..sp_color_residual_reference$value,
        sp_size_residual_reference = function() private$..sp_size_residual_reference$value,
        sp_alpha_residual_reference = function() private$..sp_alpha_residual_reference$value,
        sp_prediction_label = function() private$..sp_prediction_label$value,
        sp_prediction_color = function() private$..sp_prediction_color$value,
        sp_linetype_CI = function() private$..sp_linetype_CI$value,
        sp_color_CI = function() private$..sp_color_CI$value,
        sp_size_CI = function() private$..sp_size_CI$value,
        sp_alpha_CI = function() private$..sp_alpha_CI$value,
        sp_linetype_ref = function() private$..sp_linetype_ref$value,
        sp_color_ref = function() private$..sp_color_ref$value,
        sp_size_ref = function() private$..sp_size_ref$value,
        sp_alpha_ref = function() private$..sp_alpha_ref$value,
        sp_linetype_PI = function() private$..sp_linetype_PI$value,
        sp_color_PI = function() private$..sp_color_PI$value,
        sp_size_PI = function() private$..sp_size_PI$value,
        sp_alpha_PI = function() private$..sp_alpha_PI$value),
    private = list(
        ..switch = NA,
        ..x = NA,
        ..y = NA,
        ..r = NA,
        ..n = NA,
        ..x_variable_name = NA,
        ..y_variable_name = NA,
        ..conf_level = NA,
        ..show_details = NA,
        ..do_regression = NA,
        ..show_line = NA,
        ..show_line_CI = NA,
        ..show_residuals = NA,
        ..show_PI = NA,
        ..show_mean_lines = NA,
        ..show_r = NA,
        ..plot_as_z = NA,
        ..predict_from_x = NA,
        ..evaluate_hypotheses = NA,
        ..null_value = NA,
        ..null_boundary = NA,
        ..alpha = NA,
        ..null_color = NA,
        ..es_plot_width = NA,
        ..es_plot_height = NA,
        ..sp_plot_width = NA,
        ..sp_plot_height = NA,
        ..ymin = NA,
        ..ymax = NA,
        ..ybreaks = NA,
        ..ylab = NA,
        ..xlab = NA,
        ..axis.text.y = NA,
        ..axis.title.y = NA,
        ..axis.text.x = NA,
        ..axis.title.x = NA,
        ..error_layout = NA,
        ..sp_ymin = NA,
        ..sp_ymax = NA,
        ..sp_ybreaks = NA,
        ..sp_xmin = NA,
        ..sp_xmax = NA,
        ..sp_xbreaks = NA,
        ..sp_ylab = NA,
        ..sp_xlab = NA,
        ..sp_axis.text.y = NA,
        ..sp_axis.title.y = NA,
        ..sp_axis.text.x = NA,
        ..sp_axis.title.x = NA,
        ..shape_summary = NA,
        ..color_summary = NA,
        ..fill_summary = NA,
        ..size_summary = NA,
        ..alpha_summary = NA,
        ..linetype_summary = NA,
        ..color_interval = NA,
        ..size_interval = NA,
        ..alpha_interval = NA,
        ..alpha_error = NA,
        ..fill_error = NA,
        ..sp_shape_raw_reference = NA,
        ..sp_color_raw_reference = NA,
        ..sp_fill_raw_reference = NA,
        ..sp_size_raw_reference = NA,
        ..sp_alpha_raw_reference = NA,
        ..sp_linetype_summary_reference = NA,
        ..sp_color_summary_reference = NA,
        ..sp_size_summary_reference = NA,
        ..sp_alpha_summary_reference = NA,
        ..sp_linetype_PI_reference = NA,
        ..sp_color_PI_reference = NA,
        ..sp_size_PI_reference = NA,
        ..sp_alpha_PI_reference = NA,
        ..sp_linetype_residual_reference = NA,
        ..sp_color_residual_reference = NA,
        ..sp_size_residual_reference = NA,
        ..sp_alpha_residual_reference = NA,
        ..sp_prediction_label = NA,
        ..sp_prediction_color = NA,
        ..sp_linetype_CI = NA,
        ..sp_color_CI = NA,
        ..sp_size_CI = NA,
        ..sp_alpha_CI = NA,
        ..sp_linetype_ref = NA,
        ..sp_color_ref = NA,
        ..sp_size_ref = NA,
        ..sp_alpha_ref = NA,
        ..sp_linetype_PI = NA,
        ..sp_color_PI = NA,
        ..sp_size_PI = NA,
        ..sp_alpha_PI = NA)
)

jamovicorrelationResults <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
    "jamovicorrelationResults",
    inherit = jmvcore::Group,
    active = list(
        debug = function() private$.items[["debug"]],
        help = function() private$.items[["help"]],
        overview = function() private$.items[["overview"]],
        es_r = function() private$.items[["es_r"]],
        regression = function() private$.items[["regression"]],
        point_null = function() private$.items[["point_null"]],
        interval_null = function() private$.items[["interval_null"]],
        scatter_plot_warnings = function() private$.items[["scatter_plot_warnings"]],
        scatter_plots = function() private$.items[["scatter_plots"]],
        estimation_plot_warnings = function() private$.items[["estimation_plot_warnings"]],
        estimation_plots = function() private$.items[["estimation_plots"]]),
    private = list(),
    public=list(
        initialize=function(options) {
            super$initialize(
                options=options,
                name="",
                title="Correlations: Single Group")
            self$add(jmvcore::Preformatted$new(
                options=options,
                name="debug",
                visible=FALSE))
            self$add(jmvcore::Html$new(
                options=options,
                name="help",
                visible=FALSE))
            self$add(jmvcore::Table$new(
                options=options,
                name="overview",
                title="Overview",
                rows=2,
                clearWith=list(
                    "switch",
                    "x",
                    "y",
                    "r",
                    "n",
                    "x_variable_name",
                    "y_variable_name",
                    "conf_level",
                    "show_details"),
                columns=list(
                    list(
                        `name`="outcome_variable_name", 
                        `title`="Outcome variable", 
                        `type`="text", 
                        `combineBelow`=TRUE),
                    list(
                        `name`="mean", 
                        `type`="number", 
                        `title`="<i>M</i>"),
                    list(
                        `name`="mean_LL", 
                        `title`="LL", 
                        `type`="number"),
                    list(
                        `name`="mean_UL", 
                        `title`="UL", 
                        `type`="number"),
                    list(
                        `name`="moe", 
                        `type`="number", 
                        `title`="<i>MoE</i>", 
                        `visible`="(show_details)"),
                    list(
                        `name`="mean_SE", 
                        `title`="<i>SE</i><sub>Mean</sub>", 
                        `type`="number", 
                        `visible`="(show_details)"),
                    list(
                        `name`="median", 
                        `title`="<i>Mdn</i>", 
                        `type`="number", 
                        `visible`="(switch == 'from_raw')"),
                    list(
                        `name`="median_LL", 
                        `title`="LL", 
                        `type`="number", 
                        `visible`="(show_details & switch == 'from_raw')"),
                    list(
                        `name`="median_UL", 
                        `title`="UL", 
                        `type`="number", 
                        `visible`="(show_details & switch == 'from_raw')"),
                    list(
                        `name`="median_SE", 
                        `type`="number", 
                        `title`="<i>SE</i><sub>Median</sub>", 
                        `visible`="(show_details & switch == 'from_raw')"),
                    list(
                        `name`="sd", 
                        `type`="number", 
                        `title`="<i>s</i>"),
                    list(
                        `name`="min", 
                        `title`="Minimum", 
                        `type`="number", 
                        `visible`="(show_details & switch == 'from_raw')"),
                    list(
                        `name`="max", 
                        `title`="Maximum", 
                        `type`="number", 
                        `visible`="(show_details & switch == 'from_raw')"),
                    list(
                        `name`="q1", 
                        `title`="25th", 
                        `type`="number", 
                        `superTitle`="Percentile", 
                        `visible`="(show_details & switch == 'from_raw')"),
                    list(
                        `name`="q3", 
                        `title`="75th", 
                        `type`="number", 
                        `superTitle`="Percentile", 
                        `visible`="(show_details & switch == 'from_raw')"),
                    list(
                        `name`="n", 
                        `title`="<i>N</i>", 
                        `type`="integer"),
                    list(
                        `name`="missing", 
                        `type`="integer", 
                        `title`="Missing", 
                        `visible`="(switch == 'from_raw')"),
                    list(
                        `name`="df", 
                        `title`="<i>df</i>", 
                        `type`="integer", 
                        `visible`="(show_details)"))))
            self$add(jmvcore::Table$new(
                options=options,
                name="es_r",
                title="Linear Correlation",
                rows=1,
                clearWith=list(
                    "switch",
                    "x",
                    "y",
                    "r",
                    "n",
                    "x_variable_name",
                    "y_variable_name",
                    "conf_level",
                    "show_details"),
                columns=list(
                    list(
                        `name`="x_variable_name", 
                        `title`="<i>X</i> variable", 
                        `type`="text", 
                        `combineBelow`=TRUE),
                    list(
                        `name`="y_variable_name", 
                        `title`="<i>Y</i> variable", 
                        `type`="text", 
                        `combineBelow`=TRUE),
                    list(
                        `name`="effect", 
                        `title`="Effect", 
                        `type`="text"),
                    list(
                        `name`="effect_size", 
                        `type`="number", 
                        `title`="<i>r</i>"),
                    list(
                        `name`="LL", 
                        `title`="LL", 
                        `type`="number"),
                    list(
                        `name`="UL", 
                        `title`="UL", 
                        `type`="number"),
                    list(
                        `name`="syx", 
                        `title`="<i>s<sub>Y.X</sub></i>", 
                        `type`="number", 
                        `visible`="(switch == 'from_raw')"),
                    list(
                        `name`="SE", 
                        `title`="<i>SE<sub>r</sub></i>", 
                        `type`="number", 
                        `visible`="(show_details)"),
                    list(
                        `name`="n", 
                        `title`="<i>N</i><sub>pairs</sub>", 
                        `type`="integer"),
                    list(
                        `name`="df", 
                        `title`="<i>df</i>", 
                        `type`="integer"))))
            self$add(jmvcore::Table$new(
                options=options,
                name="regression",
                title="Regression",
                rows=2,
                visible="(do_regression & switch == \"from_raw\")",
                clearWith=list(
                    "switch",
                    "x",
                    "y",
                    "r",
                    "n",
                    "x_variable_name",
                    "y_variable_name",
                    "conf_level",
                    "show_details"),
                columns=list(
                    list(
                        `name`="component", 
                        `title`="Component", 
                        `type`="text", 
                        `combineBelow`=TRUE),
                    list(
                        `name`="values", 
                        `type`="number", 
                        `title`="Value"),
                    list(
                        `name`="LL", 
                        `title`="LL", 
                        `type`="number"),
                    list(
                        `name`="UL", 
                        `title`="UL", 
                        `type`="number"))))
            self$add(jmvcore::Table$new(
                options=options,
                name="point_null",
                title="Hypothesis Evaluation",
                rows=1,
                visible="(evaluate_hypotheses & null_boundary == 0)",
                clearWith=list(
                    "switch",
                    "x",
                    "y",
                    "r",
                    "n",
                    "x_variable_name",
                    "y_variable_name",
                    "conf_level",
                    "null_value",
                    "null_boundary"),
                columns=list(
                    list(
                        `name`="outcome_variable_name", 
                        `title`="Outcome variable", 
                        `visible`=TRUE, 
                        `type`="text", 
                        `combineBelow`=TRUE),
                    list(
                        `name`="effect", 
                        `title`="Effect", 
                        `type`="text", 
                        `combineBelow`=FALSE),
                    list(
                        `name`="null_words", 
                        `title`="<i>H</i><sub>0</sub>", 
                        `type`="text"),
                    list(
                        `name`="CI", 
                        `title`="CI", 
                        `type`="text"),
                    list(
                        `name`="CI_compare", 
                        `title`="Compare CI with <i>H</i><sub>0</sub>", 
                        `type`="text"),
                    list(
                        `name`="p", 
                        `title`="<i>p</i>, two-tailed", 
                        `type`="number", 
                        `format`="zto,pvalue"),
                    list(
                        `name`="null_decision", 
                        `title`="<i>H</i><sub>0</sub> decision"),
                    list(
                        `name`="conclusion", 
                        `title`="Conclusion", 
                        `type`="text"))))
            self$add(jmvcore::Table$new(
                options=options,
                name="interval_null",
                title="Hypothesis Evaluation",
                rows=1,
                visible="(evaluate_hypotheses & null_boundary != 0)",
                clearWith=list(
                    "switch",
                    "x",
                    "y",
                    "r",
                    "n",
                    "x_variable_name",
                    "y_variable_name",
                    "conf_level",
                    "null_value",
                    "null_boundary"),
                columns=list(
                    list(
                        `name`="outcome_variable_name", 
                        `title`="Outcome variable", 
                        `visible`=TRUE, 
                        `type`="text", 
                        `combineBelow`=TRUE),
                    list(
                        `name`="effect", 
                        `title`="Effect", 
                        `type`="text", 
                        `combineBelow`=FALSE),
                    list(
                        `name`="rope", 
                        `title`="<i>H</i><sub>0</sub>", 
                        `type`="text"),
                    list(
                        `name`="CI", 
                        `title`="CI", 
                        `type`="text"),
                    list(
                        `name`="rope_compare", 
                        `title`="Compare CI with <i>H</i><sub>0</sub>", 
                        `type`="text"),
                    list(
                        `name`="p_result", 
                        `title`="<i>p</i>, two tailed", 
                        `type`="text"),
                    list(
                        `name`="conclusion", 
                        `title`="Conclusion", 
                        `type`="text"))))
            self$add(jmvcore::Html$new(
                options=options,
                name="scatter_plot_warnings",
                title="Scatterplot Warnings",
                visible="(switch == 'from_raw')"))
            self$add(jmvcore::Image$new(
                options=options,
                name="scatter_plots",
                title="Scatterplot",
                width=650,
                height=650,
                requiresData=TRUE,
                renderFun=".scatter_plots",
                visible="(switch == 'from_raw')",
                clearWith=list(
                    "x",
                    "y",
                    "conf_level",
                    "show_line",
                    "show_line_CI",
                    "show_residuals",
                    "show_PI",
                    "show_mean_lines",
                    "show_r",
                    "plot_as_z",
                    "predict_from_x",
                    "sp_plot_width",
                    "sp_plot_height",
                    "sp_ymin",
                    "sp_ymax",
                    "sp_ybreaks",
                    "sp_xmin",
                    "sp_xmax",
                    "sp_xbreaks",
                    "sp_ylab",
                    "sp_xlab",
                    "sp_axis.text.y",
                    "sp_axis.title.y",
                    "sp_axis.text.x",
                    "sp_axis.title.x",
                    "sp_shape_raw_reference",
                    "sp_color_raw_reference",
                    "sp_fill_raw_reference",
                    "sp_size_raw_reference",
                    "sp_alpha_raw_reference",
                    "sp_linetype_summary_reference",
                    "sp_color_summary_reference",
                    "sp_size_summary_reference",
                    "sp_alpha_summary_reference",
                    "sp_linetype_PI_reference",
                    "sp_color_PI_reference",
                    "sp_size_PI_reference",
                    "sp_alpha_PI_reference",
                    "sp_linetype_residual_reference",
                    "sp_color_residual_reference",
                    "sp_size_residual_reference",
                    "sp_alpha_residual_reference",
                    "sp_prediction_label",
                    "sp_prediction_color",
                    "sp_linetype_CI",
                    "sp_color_CI",
                    "sp_size_CI",
                    "sp_alpha_CI",
                    "sp_linetype_ref",
                    "sp_color_ref",
                    "sp_size_ref",
                    "sp_alpha_ref",
                    "sp_linetype_PI",
                    "sp_color_PI",
                    "sp_size_PI",
                    "sp_alpha_PI")))
            self$add(jmvcore::Html$new(
                options=options,
                name="estimation_plot_warnings",
                title="Estimation Figure Warnings",
                visible=TRUE))
            self$add(jmvcore::Image$new(
                options=options,
                name="estimation_plots",
                title="Estimation Figure",
                width=300,
                height=400,
                requiresData=TRUE,
                renderFun=".estimation_plots"))}))

jamovicorrelationBase <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
    "jamovicorrelationBase",
    inherit = jmvcore::Analysis,
    public = list(
        initialize = function(options, data=NULL, datasetId="", analysisId="", revision=0) {
            super$initialize(
                package = "esci",
                name = "jamovicorrelation",
                version = c(1,0,0),
                options = options,
                results = jamovicorrelationResults$new(options=options),
                data = data,
                datasetId = datasetId,
                analysisId = analysisId,
                revision = revision,
                pause = NULL,
                completeWhenFilled = FALSE,
                requiresMissings = FALSE,
                weightsSupport = 'auto')
        }))

#' Correlations: Single Group
#'
#' 
#' @param switch .
#' @param data .
#' @param x .
#' @param y .
#' @param r .
#' @param n .
#' @param x_variable_name .
#' @param y_variable_name .
#' @param conf_level .
#' @param show_details .
#' @param do_regression .
#' @param show_line .
#' @param show_line_CI .
#' @param show_residuals .
#' @param show_PI .
#' @param show_mean_lines .
#' @param show_r .
#' @param plot_as_z .
#' @param predict_from_x .
#' @param evaluate_hypotheses .
#' @param null_value .
#' @param null_boundary .
#' @param alpha .
#' @param null_color .
#' @param es_plot_width .
#' @param es_plot_height .
#' @param sp_plot_width .
#' @param sp_plot_height .
#' @param ymin .
#' @param ymax .
#' @param ybreaks .
#' @param ylab .
#' @param xlab .
#' @param axis.text.y .
#' @param axis.title.y .
#' @param axis.text.x .
#' @param axis.title.x .
#' @param error_layout .
#' @param sp_ymin .
#' @param sp_ymax .
#' @param sp_ybreaks .
#' @param sp_xmin .
#' @param sp_xmax .
#' @param sp_xbreaks .
#' @param sp_ylab .
#' @param sp_xlab .
#' @param sp_axis.text.y .
#' @param sp_axis.title.y .
#' @param sp_axis.text.x .
#' @param sp_axis.title.x .
#' @param shape_summary .
#' @param color_summary .
#' @param fill_summary .
#' @param size_summary .
#' @param alpha_summary .
#' @param linetype_summary .
#' @param color_interval .
#' @param size_interval .
#' @param alpha_interval .
#' @param alpha_error .
#' @param fill_error .
#' @param sp_shape_raw_reference .
#' @param sp_color_raw_reference .
#' @param sp_fill_raw_reference .
#' @param sp_size_raw_reference .
#' @param sp_alpha_raw_reference .
#' @param sp_linetype_summary_reference .
#' @param sp_color_summary_reference .
#' @param sp_size_summary_reference .
#' @param sp_alpha_summary_reference .
#' @param sp_linetype_PI_reference .
#' @param sp_color_PI_reference .
#' @param sp_size_PI_reference .
#' @param sp_alpha_PI_reference .
#' @param sp_linetype_residual_reference .
#' @param sp_color_residual_reference .
#' @param sp_size_residual_reference .
#' @param sp_alpha_residual_reference .
#' @param sp_prediction_label .
#' @param sp_prediction_color .
#' @param sp_linetype_CI .
#' @param sp_color_CI .
#' @param sp_size_CI .
#' @param sp_alpha_CI .
#' @param sp_linetype_ref .
#' @param sp_color_ref .
#' @param sp_size_ref .
#' @param sp_alpha_ref .
#' @param sp_linetype_PI .
#' @param sp_color_PI .
#' @param sp_size_PI .
#' @param sp_alpha_PI .
#' @return A results object containing:
#' \tabular{llllll}{
#'   \code{results$debug} \tab \tab \tab \tab \tab a preformatted \cr
#'   \code{results$help} \tab \tab \tab \tab \tab a html \cr
#'   \code{results$overview} \tab \tab \tab \tab \tab a table \cr
#'   \code{results$es_r} \tab \tab \tab \tab \tab a table \cr
#'   \code{results$regression} \tab \tab \tab \tab \tab a table \cr
#'   \code{results$point_null} \tab \tab \tab \tab \tab a table \cr
#'   \code{results$interval_null} \tab \tab \tab \tab \tab a table \cr
#'   \code{results$scatter_plot_warnings} \tab \tab \tab \tab \tab a html \cr
#'   \code{results$scatter_plots} \tab \tab \tab \tab \tab an image \cr
#'   \code{results$estimation_plot_warnings} \tab \tab \tab \tab \tab a html \cr
#'   \code{results$estimation_plots} \tab \tab \tab \tab \tab an image \cr
#' }
#'
#' Tables can be converted to data frames with \code{asDF} or \code{\link{as.data.frame}}. For example:
#'
#' \code{results$overview$asDF}
#'
#' \code{as.data.frame(results$overview)}
#'
#' @export
jamovicorrelation <- function(
    switch = "from_raw",
    data,
    x,
    y,
    r = " ",
    n = " ",
    x_variable_name = "X variable",
    y_variable_name = "Y variable",
    conf_level = 95,
    show_details = FALSE,
    do_regression = FALSE,
    show_line = FALSE,
    show_line_CI = FALSE,
    show_residuals = FALSE,
    show_PI = FALSE,
    show_mean_lines = FALSE,
    show_r = FALSE,
    plot_as_z = FALSE,
    predict_from_x = " ",
    evaluate_hypotheses = FALSE,
    null_value = "0",
    null_boundary = "0",
    alpha = 0.05,
    null_color = "#A40122",
    es_plot_width = "300",
    es_plot_height = "400",
    sp_plot_width = "650",
    sp_plot_height = "650",
    ymin = "-1",
    ymax = "1",
    ybreaks = "auto",
    ylab = "auto",
    xlab = "auto",
    axis.text.y = "14",
    axis.title.y = "15",
    axis.text.x = "14",
    axis.title.x = "15",
    error_layout = "none",
    sp_ymin = "auto",
    sp_ymax = "auto",
    sp_ybreaks = "auto",
    sp_xmin = "auto",
    sp_xmax = "auto",
    sp_xbreaks = "auto",
    sp_ylab = "auto",
    sp_xlab = "auto",
    sp_axis.text.y = "14",
    sp_axis.title.y = "15",
    sp_axis.text.x = "14",
    sp_axis.title.x = "15",
    shape_summary = "circle filled",
    color_summary = "#008DF9",
    fill_summary = "#008DF9",
    size_summary = "4",
    alpha_summary = "1",
    linetype_summary = "solid",
    color_interval = "black",
    size_interval = "3",
    alpha_interval = "1",
    alpha_error = "1",
    fill_error = "gray75",
    sp_shape_raw_reference = "circle filled",
    sp_color_raw_reference = "black",
    sp_fill_raw_reference = "#008DF9",
    sp_size_raw_reference = "3",
    sp_alpha_raw_reference = ".25",
    sp_linetype_summary_reference = "solid",
    sp_color_summary_reference = "#008DF9",
    sp_size_summary_reference = "3",
    sp_alpha_summary_reference = ".25",
    sp_linetype_PI_reference = "dotted",
    sp_color_PI_reference = "#E20134",
    sp_size_PI_reference = "2",
    sp_alpha_PI_reference = "1",
    sp_linetype_residual_reference = "solid",
    sp_color_residual_reference = "#E20134",
    sp_size_residual_reference = "1",
    sp_alpha_residual_reference = "1",
    sp_prediction_label = "5",
    sp_prediction_color = "#E20134",
    sp_linetype_CI = "solid",
    sp_color_CI = "#008DF9",
    sp_size_CI = "4",
    sp_alpha_CI = "1",
    sp_linetype_ref = "dotted",
    sp_color_ref = "gray60",
    sp_size_ref = "1",
    sp_alpha_ref = "1",
    sp_linetype_PI = "solid",
    sp_color_PI = "#E20134",
    sp_size_PI = "2",
    sp_alpha_PI = "1") {

    if ( ! requireNamespace("jmvcore", quietly=TRUE))
        stop("jamovicorrelation requires jmvcore to be installed (restart may be required)")

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


    options <- jamovicorrelationOptions$new(
        switch = switch,
        x = x,
        y = y,
        r = r,
        n = n,
        x_variable_name = x_variable_name,
        y_variable_name = y_variable_name,
        conf_level = conf_level,
        show_details = show_details,
        do_regression = do_regression,
        show_line = show_line,
        show_line_CI = show_line_CI,
        show_residuals = show_residuals,
        show_PI = show_PI,
        show_mean_lines = show_mean_lines,
        show_r = show_r,
        plot_as_z = plot_as_z,
        predict_from_x = predict_from_x,
        evaluate_hypotheses = evaluate_hypotheses,
        null_value = null_value,
        null_boundary = null_boundary,
        alpha = alpha,
        null_color = null_color,
        es_plot_width = es_plot_width,
        es_plot_height = es_plot_height,
        sp_plot_width = sp_plot_width,
        sp_plot_height = sp_plot_height,
        ymin = ymin,
        ymax = ymax,
        ybreaks = ybreaks,
        ylab = ylab,
        xlab = xlab,
        axis.text.y = axis.text.y,
        axis.title.y = axis.title.y,
        axis.text.x = axis.text.x,
        axis.title.x = axis.title.x,
        error_layout = error_layout,
        sp_ymin = sp_ymin,
        sp_ymax = sp_ymax,
        sp_ybreaks = sp_ybreaks,
        sp_xmin = sp_xmin,
        sp_xmax = sp_xmax,
        sp_xbreaks = sp_xbreaks,
        sp_ylab = sp_ylab,
        sp_xlab = sp_xlab,
        sp_axis.text.y = sp_axis.text.y,
        sp_axis.title.y = sp_axis.title.y,
        sp_axis.text.x = sp_axis.text.x,
        sp_axis.title.x = sp_axis.title.x,
        shape_summary = shape_summary,
        color_summary = color_summary,
        fill_summary = fill_summary,
        size_summary = size_summary,
        alpha_summary = alpha_summary,
        linetype_summary = linetype_summary,
        color_interval = color_interval,
        size_interval = size_interval,
        alpha_interval = alpha_interval,
        alpha_error = alpha_error,
        fill_error = fill_error,
        sp_shape_raw_reference = sp_shape_raw_reference,
        sp_color_raw_reference = sp_color_raw_reference,
        sp_fill_raw_reference = sp_fill_raw_reference,
        sp_size_raw_reference = sp_size_raw_reference,
        sp_alpha_raw_reference = sp_alpha_raw_reference,
        sp_linetype_summary_reference = sp_linetype_summary_reference,
        sp_color_summary_reference = sp_color_summary_reference,
        sp_size_summary_reference = sp_size_summary_reference,
        sp_alpha_summary_reference = sp_alpha_summary_reference,
        sp_linetype_PI_reference = sp_linetype_PI_reference,
        sp_color_PI_reference = sp_color_PI_reference,
        sp_size_PI_reference = sp_size_PI_reference,
        sp_alpha_PI_reference = sp_alpha_PI_reference,
        sp_linetype_residual_reference = sp_linetype_residual_reference,
        sp_color_residual_reference = sp_color_residual_reference,
        sp_size_residual_reference = sp_size_residual_reference,
        sp_alpha_residual_reference = sp_alpha_residual_reference,
        sp_prediction_label = sp_prediction_label,
        sp_prediction_color = sp_prediction_color,
        sp_linetype_CI = sp_linetype_CI,
        sp_color_CI = sp_color_CI,
        sp_size_CI = sp_size_CI,
        sp_alpha_CI = sp_alpha_CI,
        sp_linetype_ref = sp_linetype_ref,
        sp_color_ref = sp_color_ref,
        sp_size_ref = sp_size_ref,
        sp_alpha_ref = sp_alpha_ref,
        sp_linetype_PI = sp_linetype_PI,
        sp_color_PI = sp_color_PI,
        sp_size_PI = sp_size_PI,
        sp_alpha_PI = sp_alpha_PI)

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

    analysis$run()

    analysis$results
}
rcalinjageman/esci documentation built on March 29, 2024, 7:30 p.m.