Nothing
# This file is automatically generated, you probably don't want to edit this
multiResponsejmvOptions <- if (requireNamespace('jmvcore', quietly=TRUE)) R6::R6Class(
"multiResponsejmvOptions",
inherit = jmvcore::Options,
public = list(
initialize = function(
items = NULL,
endorsedOption = 1, ...) {
super$initialize(
package='ufs',
name='multiResponsejmv',
requiresData=TRUE,
...)
private$..items <- jmvcore::OptionVariables$new(
"items",
items)
private$..endorsedOption <- jmvcore::OptionNumber$new(
"endorsedOption",
endorsedOption,
default=1)
self$.addOption(private$..items)
self$.addOption(private$..endorsedOption)
}),
active = list(
items = function() private$..items$value,
endorsedOption = function() private$..endorsedOption$value),
private = list(
..items = NA,
..endorsedOption = NA)
)
multiResponsejmvResults <- if (requireNamespace('jmvcore', quietly=TRUE)) R6::R6Class(
inherit = jmvcore::Group,
active = list(
table = function() private$.items[["table"]]),
private = list(),
public=list(
initialize=function(options) {
super$initialize(
options=options,
name="",
title="Multi Response")
self$add(jmvcore::Table$new(
options=options,
name="table",
title="Multi Response",
rows="(items)",
columns=list(
list(
`name`="var",
`title`="Option",
`type`="text",
`content`="($key)"),
list(
`name`="freq",
`title`="Frequency",
`type`="integer"),
list(
`name`="percentageResp",
`title`="Percentage of responses",
`type`="number"),
list(
`name`="percentageCases",
`title`="Percentage of cases",
`type`="number"))))}))
multiResponsejmvBase <- if (requireNamespace('jmvcore', quietly=TRUE)) R6::R6Class(
"multiResponsejmvBase",
inherit = jmvcore::Analysis,
public = list(
initialize = function(options, data=NULL, datasetId="", analysisId="", revision=0) {
super$initialize(
package = 'ufs',
name = 'multiResponsejmv',
version = c(1,0,0),
options = options,
results = multiResponsejmvResults$new(options=options),
data = data,
datasetId = datasetId,
analysisId = analysisId,
revision = revision,
pause = NULL,
completeWhenFilled = FALSE)
}))
#' Multi Response
#'
#'
#' @param data .
#' @param items .
#' @param endorsedOption .
#' @return A results object containing:
#' \tabular{llllll}{
#' \code{results$table} \tab \tab \tab \tab \tab a table \cr
#' }
#'
#' Tables can be converted to data frames with \code{asDF} or \code{\link{as.data.frame}}. For example:
#'
#' \code{results$table$asDF}
#'
#' \code{as.data.frame(results$table)}
#'
#' @export
multiResponsejmv <- if (requireNamespace('jmvcore', quietly=TRUE)) function(
data,
items,
endorsedOption = 1) {
if ( ! requireNamespace('jmvcore'))
stop('multiResponsejmv requires jmvcore to be installed (restart may be required)')
if ( ! missing(items)) items <- jmvcore::resolveQuo(jmvcore::enquo(items))
if (missing(data))
data <- jmvcore::marshalData(
parent.frame(),
`if`( ! missing(items), items, NULL))
options <- multiResponsejmvOptions$new(
items = items,
endorsedOption = endorsedOption)
analysis <- multiResponsejmvClass$new(
options = options,
data = data)
analysis$run()
analysis$results
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.