From 9a45a583e73edf2d6cafb03ac347dedc5fd42f0b Mon Sep 17 00:00:00 2001 From: SERDAR BALCI Date: Tue, 14 Jul 2020 18:21:18 +0300 Subject: [PATCH] Prepared for release at: 2020-07-14 18:21:18 --- R/jjhistostats.b.R | 96 +++++++++++++++++++------------------- R/jjhistostats.h.R | 21 ++------- jamovi/jjhistostats.a.yaml | 8 ++-- jamovi/jjhistostats.u.yaml | 2 - man/jjhistostats.Rd | 4 +- 5 files changed, 58 insertions(+), 73 deletions(-) diff --git a/R/jjhistostats.b.R b/R/jjhistostats.b.R index ba34802..22f9e98 100644 --- a/R/jjhistostats.b.R +++ b/R/jjhistostats.b.R @@ -125,7 +125,7 @@ jjhistostatsClass <- if (requireNamespace('jmvcore')) R6::R6Class( # group <- jmvcore::composeTerm(components = group) - originaltheme <- self$options$originaltheme + # originaltheme <- self$options$originaltheme # gghistostats ---- @@ -133,57 +133,57 @@ jjhistostatsClass <- if (requireNamespace('jmvcore')) R6::R6Class( - # plot <- - # ggstatsplot::gghistostats( - # data = mydata, - # x = !!dep, - # # binwidth = NULL, - # # bar.measure = "count", - # # xlab = NULL, - # # title = NULL, - # # subtitle = NULL, - # # caption = NULL, - # # type = "parametric", - # # test.value = 0, - # # bf.prior = 0.707, - # # bf.message = TRUE, - # # effsize.type = "g", - # # conf.level = 0.95, - # # nboot = 100, - # # k = 2L, - # ggtheme = NULL, - # # ggtheme = ggplot2::theme_bw(), - # ggstatsplot.layer = FALSE, - # # ggstatsplot.layer = TRUE, - # # ggstatsplot.layer = originaltheme, - # # bar.fill = "grey50", - # # results.subtitle = TRUE, - # # test.k = 0, - # # test.value.line = FALSE, - # # test.value.line.args = list(size = 1), - # # test.value.label.args = list(size = 3), - # # centrality.parameter = "mean", - # # centrality.k = 2, - # # centrality.line.args = list(size = 1, color = "blue"), - # # centrality.label.args = list(color = "blue", size = 3), - # # normal.curve = FALSE, - # # normal.curve.args = list(size = 3), - # # ggplot.component = NULL, - # # output = "plot", - # # messages = TRUE - # ) - - - plot <- ggstatsplot::gghistostats(iris, - x = Sepal.Length , - ggtheme = NULL, - ggstatsplot.layer = FALSE - ) + plot <- + ggstatsplot::gghistostats( + data = mydata, + x = !!dep, + # binwidth = NULL, + # bar.measure = "count", + # xlab = NULL, + # title = NULL, + # subtitle = NULL, + # caption = NULL, + # type = "parametric", + # test.value = 0, + # bf.prior = 0.707, + # bf.message = TRUE, + # effsize.type = "g", + # conf.level = 0.95, + # nboot = 100, + # k = 2L, + # ggtheme = NULL, + ggtheme = ggplot2::theme_bw(), + # ggstatsplot.layer = FALSE, + ggstatsplot.layer = TRUE, + # ggstatsplot.layer = originaltheme, + # bar.fill = "grey50", + # results.subtitle = TRUE, + # test.k = 0, + # test.value.line = FALSE, + # test.value.line.args = list(size = 1), + # test.value.label.args = list(size = 3), + # centrality.parameter = "mean", + # centrality.k = 2, + # centrality.line.args = list(size = 1, color = "blue"), + # centrality.label.args = list(color = "blue", size = 3), + # normal.curve = FALSE, + # normal.curve.args = list(size = 3), + # ggplot.component = NULL, + # output = "plot", + # messages = TRUE + ) + + + # plot <- ggstatsplot::gghistostats(iris, + # x = Sepal.Length , + # ggtheme = NULL, + # ggstatsplot.layer = FALSE + # ) # Print Plot ---- - plot <- plot + ggtheme + # plot <- plot + ggtheme print(plot) TRUE diff --git a/R/jjhistostats.h.R b/R/jjhistostats.h.R index 97d11a3..9866aab 100644 --- a/R/jjhistostats.h.R +++ b/R/jjhistostats.h.R @@ -8,8 +8,7 @@ jjhistostatsOptions <- if (requireNamespace('jmvcore')) R6::R6Class( initialize = function( dep = NULL, grvar = NULL, - excl = TRUE, - originaltheme = FALSE, ...) { + excl = TRUE, ...) { super$initialize( package='jjstatsplot', @@ -36,26 +35,19 @@ jjhistostatsOptions <- if (requireNamespace('jmvcore')) R6::R6Class( "excl", excl, default=TRUE) - private$..originaltheme <- jmvcore::OptionBool$new( - "originaltheme", - originaltheme, - default=FALSE) self$.addOption(private$..dep) self$.addOption(private$..grvar) self$.addOption(private$..excl) - self$.addOption(private$..originaltheme) }), active = list( dep = function() private$..dep$value, grvar = function() private$..grvar$value, - excl = function() private$..excl$value, - originaltheme = function() private$..originaltheme$value), + excl = function() private$..excl$value), private = list( ..dep = NA, ..grvar = NA, - ..excl = NA, - ..originaltheme = NA) + ..excl = NA) ) jjhistostatsResults <- if (requireNamespace('jmvcore')) R6::R6Class( @@ -146,7 +138,6 @@ jjhistostatsBase <- if (requireNamespace('jmvcore')) R6::R6Class( #' @param dep . #' @param grvar . #' @param excl . -#' @param originaltheme . #' @return A results object containing: #' \tabular{llllll}{ #' \code{results$todo} \tab \tab \tab \tab \tab a html \cr @@ -159,8 +150,7 @@ jjhistostats <- function( data, dep, grvar, - excl = TRUE, - originaltheme = FALSE) { + excl = TRUE) { if ( ! requireNamespace('jmvcore')) stop('jjhistostats requires jmvcore to be installed (restart may be required)') @@ -178,8 +168,7 @@ jjhistostats <- function( options <- jjhistostatsOptions$new( dep = dep, grvar = grvar, - excl = excl, - originaltheme = originaltheme) + excl = excl) analysis <- jjhistostatsClass$new( options = options, diff --git a/jamovi/jjhistostats.a.yaml b/jamovi/jjhistostats.a.yaml index 8d8990c..7b1fc72 100644 --- a/jamovi/jjhistostats.a.yaml +++ b/jamovi/jjhistostats.a.yaml @@ -59,10 +59,10 @@ options: default: true - - name: originaltheme - title: Add GGStatsPlot Layer - type: Bool - default: false + # - name: originaltheme + # title: Add GGStatsPlot Layer + # type: Bool + # default: false diff --git a/jamovi/jjhistostats.u.yaml b/jamovi/jjhistostats.u.yaml index fe65409..8fd463e 100644 --- a/jamovi/jjhistostats.u.yaml +++ b/jamovi/jjhistostats.u.yaml @@ -27,5 +27,3 @@ children: children: - type: CheckBox name: excl - - type: CheckBox - name: originaltheme diff --git a/man/jjhistostats.Rd b/man/jjhistostats.Rd index 8e797b2..b7235fb 100644 --- a/man/jjhistostats.Rd +++ b/man/jjhistostats.Rd @@ -4,7 +4,7 @@ \alias{jjhistostats} \title{Histogram} \usage{ -jjhistostats(data, dep, grvar, excl = TRUE, originaltheme = FALSE) +jjhistostats(data, dep, grvar, excl = TRUE) } \arguments{ \item{data}{The data as a data frame.} @@ -14,8 +14,6 @@ jjhistostats(data, dep, grvar, excl = TRUE, originaltheme = FALSE) \item{grvar}{.} \item{excl}{.} - -\item{originaltheme}{.} } \value{ A results object containing: