Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sbalci committed Jan 30, 2020
1 parent 48054b0 commit 08473bf
Show file tree
Hide file tree
Showing 50 changed files with 924 additions and 2,781 deletions.
5 changes: 2 additions & 3 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
### License
^LICENSE\.md$

### Hex logo
^img/

### Jamovi
^jamovi/
.jmo$
Expand All @@ -47,3 +44,5 @@ build
^tests$

^\.github/
^docs$
^pkgdown$
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ Imports:
explore,
tangram,
irr,
rlang
rlang,
tidyselect
Remotes:
easystats/insight,
easystats/parameters,
easystats/report
Suggests:
remotes,
devtools,
tidyselect,
lubridate,
broom,
GGally,
gridExtra,
Expand Down
11 changes: 10 additions & 1 deletion R/agreement.b.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#' Agreement
#'
#'
#' @importFrom R6 R6Class
#' @import jmvcore

# This file is a generated template, your changes will not be overwritten

Expand Down Expand Up @@ -25,10 +30,14 @@ agreementClass <- if (requireNamespace('jmvcore')) R6::R6Class(

result1 <- irr::agree(ratings)


result2 <- irr::kappa2(ratings)







self$results$text1$setContent(result1)

self$results$text2$setContent(result2)
Expand Down
17 changes: 17 additions & 0 deletions R/cluster.b.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#' @importFrom R6 R6Class
#' @import jmvcore
#'
# This file is a generated template, your changes will not be overwritten

clusterClass <- if (requireNamespace('jmvcore')) R6::R6Class(
"clusterClass",
inherit = clusterBase,
private = list(
.run = function() {

# `self$data` contains the data
# `self$options` contains the options
# `self$results` contains the results object (to populate)

})
)
137 changes: 137 additions & 0 deletions R/cluster.h.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@

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

clusterOptions <- if (requireNamespace('jmvcore')) R6::R6Class(
"clusterOptions",
inherit = jmvcore::Options,
public = list(
initialize = function(
dep = NULL,
group = NULL,
alt = "notequal",
varEq = TRUE, ...) {

super$initialize(
package='ClinicoPath',
name='cluster',
requiresData=TRUE,
...)

private$..dep <- jmvcore::OptionVariable$new(
"dep",
dep)
private$..group <- jmvcore::OptionVariable$new(
"group",
group)
private$..alt <- jmvcore::OptionList$new(
"alt",
alt,
options=list(
"notequal",
"onegreater",
"twogreater"),
default="notequal")
private$..varEq <- jmvcore::OptionBool$new(
"varEq",
varEq,
default=TRUE)

self$.addOption(private$..dep)
self$.addOption(private$..group)
self$.addOption(private$..alt)
self$.addOption(private$..varEq)
}),
active = list(
dep = function() private$..dep$value,
group = function() private$..group$value,
alt = function() private$..alt$value,
varEq = function() private$..varEq$value),
private = list(
..dep = NA,
..group = NA,
..alt = NA,
..varEq = NA)
)

clusterResults <- if (requireNamespace('jmvcore')) R6::R6Class(
inherit = jmvcore::Group,
active = list(
text = function() private$.items[["text"]]),
private = list(),
public=list(
initialize=function(options) {
super$initialize(
options=options,
name="",
title="Cluster Analysis")
self$add(jmvcore::Preformatted$new(
options=options,
name="text",
title="Cluster Analysis"))}))

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

#' Cluster Analysis
#'
#'
#' @param data .
#' @param dep .
#' @param group .
#' @param alt .
#' @param varEq .
#' @return A results object containing:
#' \tabular{llllll}{
#' \code{results$text} \tab \tab \tab \tab \tab a preformatted \cr
#' }
#'
#' @export
cluster <- function(
data,
dep,
group,
alt = "notequal",
varEq = TRUE) {

if ( ! requireNamespace('jmvcore'))
stop('cluster 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(data))
data <- jmvcore::marshalData(
parent.frame(),
`if`( ! missing(dep), dep, NULL),
`if`( ! missing(group), group, NULL))


options <- clusterOptions$new(
dep = dep,
group = group,
alt = alt,
varEq = varEq)

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

analysis$run()

analysis$results
}
4 changes: 3 additions & 1 deletion R/correlation.b.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

#' @importFrom R6 R6Class
#' @import jmvcore
#'
# This file is a generated template, your changes will not be overwritten

correlationClass <- if (requireNamespace('jmvcore')) R6::R6Class(
Expand Down
4 changes: 3 additions & 1 deletion R/crosstable.b.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

#' @importFrom R6 R6Class
#' @import jmvcore
#'
# This file is a generated template, your changes will not be overwritten

crosstableClass <- if (requireNamespace('jmvcore')) R6::R6Class(
Expand Down
4 changes: 3 additions & 1 deletion R/decision.b.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

#' @importFrom R6 R6Class
#' @import jmvcore
#'
# This file is a generated template, your changes will not be overwritten

decisionClass <- if (requireNamespace('jmvcore')) R6::R6Class(
Expand Down
4 changes: 3 additions & 1 deletion R/decisioncalculator.b.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

#' @importFrom R6 R6Class
#' @import jmvcore
#'
# This file is a generated template, your changes will not be overwritten

decisioncalculatorClass <- if (requireNamespace('jmvcore')) R6::R6Class(
Expand Down
4 changes: 3 additions & 1 deletion R/frequencies.b.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

#' @importFrom R6 R6Class
#' @import jmvcore
#'
# This file is a generated template, your changes will not be overwritten

frequenciesClass <- if (requireNamespace('jmvcore')) R6::R6Class(
Expand Down
4 changes: 3 additions & 1 deletion R/multisurvival.b.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

#' @importFrom R6 R6Class
#' @import jmvcore
#'
# This file is a generated template, your changes will not be overwritten

multisurvivalClass <- if (requireNamespace('jmvcore')) R6::R6Class(
Expand Down
4 changes: 3 additions & 1 deletion R/report.b.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

#' @importFrom R6 R6Class
#' @import jmvcore
#'
# This file is a generated template, your changes will not be overwritten

reportClass <- if (requireNamespace('jmvcore')) R6::R6Class(
Expand Down
26 changes: 24 additions & 2 deletions R/statsplot2.b.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

#' @importFrom R6 R6Class
#' @import jmvcore
#'
# This file is a generated template, your changes will not be overwritten

statsplot2Class <- if (requireNamespace('jmvcore')) R6::R6Class(
Expand All @@ -7,6 +9,10 @@ statsplot2Class <- if (requireNamespace('jmvcore')) R6::R6Class(
private = list(
.run = function() {

if(is.null(self$options$dep) || is.null(self$options$group))
return()


mydata <- self$data

mydep <- self$data[[self$options$dep]]
Expand All @@ -17,10 +23,26 @@ statsplot2Class <- if (requireNamespace('jmvcore')) R6::R6Class(
plotData <- jmvcore::naOmit(plotData)

image <- self$results$plot

image$setState(plotData)


self$results$text1$setContent(plotData)
# self$results$text1$setContent(plotData)


# mydepType <- data.frame(vclass = class(mydep),
# vtypeof = typeof(mydep),
# vordered = is.ordered(mydep),
# vfactor = is.factor(mydep),
# vnumeric = is.numeric(mydep),
# vdouble = is.double(mydep),
# vcharacter = is.character(mydep),
# vdate = lubridate::is.Date(mydep),
# vdate2 = is.na.POSIXlt(mydep)
# )
# mygroupType <- class(mygroup)
# variableTypes <- list(mydepType, mygroupType)
# self$results$text1$setContent(variableTypes)



Expand Down
15 changes: 15 additions & 0 deletions R/tree.b.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# This file is a generated template, your changes will not be overwritten

treeClass <- if (requireNamespace('jmvcore')) R6::R6Class(
"treeClass",
inherit = treeBase,
private = list(
.run = function() {

# `self$data` contains the data
# `self$options` contains the options
# `self$results` contains the results object (to populate)

})
)
Loading

0 comments on commit 08473bf

Please sign in to comment.