Skip to content

Commit

Permalink
Prepared for release at: 2020-07-14 18:21:18
Browse files Browse the repository at this point in the history
  • Loading branch information
sbalci committed Jul 14, 2020
1 parent 9e0b575 commit 9a45a58
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 73 deletions.
96 changes: 48 additions & 48 deletions R/jjhistostats.b.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,65 +125,65 @@ jjhistostatsClass <- if (requireNamespace('jmvcore')) R6::R6Class(
# group <- jmvcore::composeTerm(components = group)


originaltheme <- self$options$originaltheme
# originaltheme <- self$options$originaltheme


# gghistostats ----
# https://indrajeetpatil.github.io/ggstatsplot/reference/gghistostats.html



# 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
Expand Down
21 changes: 5 additions & 16 deletions R/jjhistostats.h.R
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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(
Expand Down Expand Up @@ -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
Expand All @@ -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)')
Expand All @@ -178,8 +168,7 @@ jjhistostats <- function(
options <- jjhistostatsOptions$new(
dep = dep,
grvar = grvar,
excl = excl,
originaltheme = originaltheme)
excl = excl)

analysis <- jjhistostatsClass$new(
options = options,
Expand Down
8 changes: 4 additions & 4 deletions jamovi/jjhistostats.a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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



Expand Down
2 changes: 0 additions & 2 deletions jamovi/jjhistostats.u.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ children:
children:
- type: CheckBox
name: excl
- type: CheckBox
name: originaltheme
4 changes: 1 addition & 3 deletions man/jjhistostats.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9a45a58

Please sign in to comment.