Skip to content

Commit

Permalink
for release
Browse files Browse the repository at this point in the history
  • Loading branch information
sbalci committed Jul 4, 2020
1 parent fa63637 commit b4d7eba
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 70 deletions.
36 changes: 1 addition & 35 deletions R/jjbarstats.h.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ jjbarstatsOptions <- if (requireNamespace('jmvcore')) R6::R6Class(
initialize = function(
dep = NULL,
group = NULL,
grvar = NULL,
counts = NULL,
excl = TRUE, ...) {

super$initialize(
Expand All @@ -34,43 +32,22 @@ jjbarstatsOptions <- if (requireNamespace('jmvcore')) R6::R6Class(
"nominal"),
permitted=list(
"factor"))
private$..grvar <- jmvcore::OptionVariable$new(
"grvar",
grvar,
suggested=list(
"ordinal",
"nominal"),
permitted=list(
"factor"))
private$..counts <- jmvcore::OptionVariable$new(
"counts",
counts,
suggested=list(
"continuous"),
permitted=list(
"numeric"))
private$..excl <- jmvcore::OptionBool$new(
"excl",
excl,
default=TRUE)

self$.addOption(private$..dep)
self$.addOption(private$..group)
self$.addOption(private$..grvar)
self$.addOption(private$..counts)
self$.addOption(private$..excl)
}),
active = list(
dep = function() private$..dep$value,
group = function() private$..group$value,
grvar = function() private$..grvar$value,
counts = function() private$..counts$value,
excl = function() private$..excl$value),
private = list(
..dep = NA,
..group = NA,
..grvar = NA,
..counts = NA,
..excl = NA)
)

Expand Down Expand Up @@ -145,8 +122,6 @@ jjbarstatsBase <- if (requireNamespace('jmvcore')) R6::R6Class(
#' @param data The data as a data frame.
#' @param dep .
#' @param group .
#' @param grvar .
#' @param counts .
#' @param excl .
#' @return A results object containing:
#' \tabular{llllll}{
Expand All @@ -159,34 +134,25 @@ jjbarstats <- function(
data,
dep,
group,
grvar,
counts,
excl = TRUE) {

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

if ( ! missing(dep)) dep <- jmvcore::resolveQuo(jmvcore::enquo(dep))
if ( ! missing(group)) group <- jmvcore::resolveQuo(jmvcore::enquo(group))
if ( ! missing(grvar)) grvar <- jmvcore::resolveQuo(jmvcore::enquo(grvar))
if ( ! missing(counts)) counts <- jmvcore::resolveQuo(jmvcore::enquo(counts))
if (missing(data))
data <- jmvcore::marshalData(
parent.frame(),
`if`( ! missing(dep), dep, NULL),
`if`( ! missing(group), group, NULL),
`if`( ! missing(grvar), grvar, NULL),
`if`( ! missing(counts), counts, NULL))
`if`( ! missing(group), group, NULL))

for (v in dep) if (v %in% names(data)) data[[v]] <- as.factor(data[[v]])
for (v in group) if (v %in% names(data)) data[[v]] <- as.factor(data[[v]])
for (v in grvar) if (v %in% names(data)) data[[v]] <- as.factor(data[[v]])

options <- jjbarstatsOptions$new(
dep = dep,
group = group,
grvar = grvar,
counts = counts,
excl = excl)

analysis <- jjbarstatsClass$new(
Expand Down
2 changes: 1 addition & 1 deletion R/jjwithinstats.b.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jjwithinstatsClass <- if (requireNamespace('jmvcore')) R6::R6Class(
todo <- glue::glue(
"<br>Welcome to ClinicoPath
<br><br>
This tool will help you generate Bar Charts.
This tool will help you generate Violin Plots for repeated measurements.
<br><br>
This function uses ggplot2 and ggstatsplot packages. See documentations <a href = 'https://indrajeetpatil.github.io/ggstatsplot/reference/ggwithinstats.html' target='_blank'>ggwithinstats</a> and <a href = 'https://indrajeetpatil.github.io/ggstatsplot/reference/grouped_ggwithinstats.html' target='_blank'>grouped_ggwithinstats</a>.
<br>
Expand Down
4 changes: 2 additions & 2 deletions R/jjwithinstats.h.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jjwithinstatsResults <- if (requireNamespace('jmvcore')) R6::R6Class(
super$initialize(
options=options,
name="",
title="Violin Plots to Compare Between Groups",
title="Violin Plots to Compare Within Groups",
refs=list(
"ggplot2",
"ggstatsplot"))
Expand Down Expand Up @@ -135,7 +135,7 @@ jjwithinstatsBase <- if (requireNamespace('jmvcore')) R6::R6Class(
requiresMissings = FALSE)
}))

#' Violin Plots to Compare Between Groups
#' Violin Plots to Compare Within Groups
#'
#'
#'
Expand Down
Binary file modified data/histopathologyGraphsPlots.omv
Binary file not shown.
6 changes: 3 additions & 3 deletions jamovi/0000.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ analyses:
menuSubgroup: Continious vs Continious
menuTitle: Scatter Plot
menuSubtitle: Scatter Plot
- title: Violin Plots to Compare Between Groups
- title: Violin Plots to Compare Within Groups
name: jjwithinstats
ns: jjstatsplot
menuGroup: JJStatsPlot
menuSubgroup: Categorical vs Numeric
menuTitle: Violin Plots to Compare Between Groups
menuSubtitle: Categorical vs Numeric
menuTitle: Violin Plots to Compare Within Groups
menuSubtitle: Repeated Measurements
- title: Graphs and Plots
name: statsplot2
ns: jjstatsplot
Expand Down
22 changes: 11 additions & 11 deletions jamovi/jjbarstats.a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ options:
suggested: [ ordinal, nominal ]
permitted: [ factor ]

- name: grvar
title: 'Split by: (Optional)'
type: Variable
suggested: [ ordinal, nominal ]
permitted: [ factor ]

- name: counts
title: 'Counts: (Optional)'
type: Variable
suggested: [ continuous ]
permitted: [ numeric ]
# - name: grvar
# title: 'Split by: (Optional)'
# type: Variable
# suggested: [ ordinal, nominal ]
# permitted: [ factor ]

# - name: counts
# title: 'Counts: (Optional)'
# type: Variable
# suggested: [ continuous ]
# permitted: [ numeric ]


# - name: direction
Expand Down
14 changes: 0 additions & 14 deletions jamovi/jjbarstats.u.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,6 @@ children:
name: group
maxItemCount: 1
isTarget: true
- type: TargetLayoutBox
label: 'Split by: (Optional)'
children:
- type: VariablesListBox
name: grvar
maxItemCount: 1
isTarget: true
- type: TargetLayoutBox
label: 'Counts: (Optional)'
children:
- type: VariablesListBox
name: counts
maxItemCount: 1
isTarget: true
- type: LayoutBox
margin: large
children:
Expand Down
4 changes: 2 additions & 2 deletions jamovi/jjwithinstats.a.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: jjwithinstats
title: Violin Plots to Compare Between Groups
title: Violin Plots to Compare Within Groups
menuGroup: JJStatsPlot
menuSubgroup: Categorical vs Numeric
menuSubtitle: Categorical vs Numeric
menuSubtitle: Repeated Measurements
version: '1.0.0'
jas: '1.2'

Expand Down
2 changes: 1 addition & 1 deletion jamovi/jjwithinstats.r.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: jjwithinstats
title: Violin Plots to Compare Between Groups
title: Violin Plots to Compare Within Groups
jrs: '1.1'

items:
Expand Down
2 changes: 1 addition & 1 deletion jamovi/jjwithinstats.u.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title: Violin Plots to Compare Between Groups
title: Violin Plots to Compare Within Groups
name: jjwithinstats
jus: '3.0'
stage: 0
Expand Down

0 comments on commit b4d7eba

Please sign in to comment.