R/jamovibaplotqq.h.R

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

jamoviBAplotQQOptions <- if (requireNamespace('jmvcore')) R6::R6Class(
    "jamoviBAplotQQOptions",
    inherit = jmvcore::Options,
    public = list(
        initialize = function(
            method1 = NULL,
            method2 = NULL, ...) {

            super$initialize(
                package='blandr',
                name='jamoviBAplotQQ',
                requiresData=TRUE,
                ...)

            private$..method1 <- jmvcore::OptionVariable$new(
                "method1",
                method1,
                suggested=list(
                    "continuous"),
                permitted=list(
                    "continuous",
                    "nominal",
                    "ordinal"))
            private$..method2 <- jmvcore::OptionVariable$new(
                "method2",
                method2,
                suggested=list(
                    "continuous"),
                permitted=list(
                    "continuous",
                    "nominal",
                    "ordinal"))

            self$.addOption(private$..method1)
            self$.addOption(private$..method2)
        }),
    active = list(
        method1 = function() private$..method1$value,
        method2 = function() private$..method2$value),
    private = list(
        ..method1 = NA,
        ..method2 = NA)
)

jamoviBAplotQQResults <- if (requireNamespace('jmvcore')) R6::R6Class(
    inherit = jmvcore::Group,
    active = list(
        plot = function() private$.items[["plot"]]),
    private = list(),
    public=list(
        initialize=function(options) {
            super$initialize(
                options=options,
                name="",
                title="Bland-Altman differences QQ plot")
            self$add(jmvcore::Image$new(
                options=options,
                name="plot",
                width=600,
                height=450,
                renderFun=".plot"))}))

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

#' Differences Q-Q Plot
#'
#' 
#' @param data .
#' @param method1 .
#' @param method2 .
#' @return A results object containing:
#' \tabular{llllll}{
#'   \code{results$plot} \tab \tab \tab \tab \tab an image \cr
#' }
#'
#' @export
jamoviBAplotQQ <- function(
    data,
    method1,
    method2) {

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

    options <- jamoviBAplotQQOptions$new(
        method1 = method1,
        method2 = method2)

    results <- jamoviBAplotQQResults$new(
        options = options)

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

    analysis$run()

    analysis$results
}

Try the blandr package in your browser

Any scripts or data that you put into this service are public.

blandr documentation built on May 2, 2019, 6:50 a.m.