analysisOptions: Obtain options to run JASP analyses with.

View source: R/options.R

analysisOptionsR Documentation

Obtain options to run JASP analyses with.

Description

analysisOptions provides an easy way to create analysis options that can be supplied to runAnalysis.

Usage

analysisOptions(source)

Arguments

source

One of three: (1) R function name, (2) path to .jasp file or (3) json string. See the details section for more information.

Details

There are three types of allowed input. 1) The name of the R function of the analysis (case-sensitive); jaspTools will attempt to read the .qml file for that analysis and create a set of default options. 2) the path to .jasp file that has one or more analyses. Or (3) a json string that was sent by the JASP application. This json can be obtained by having JASP log to file (JASP>Preferences>Advanced>Log to file). The logs can be found by clicking 'Show logs" in the "Logging options". Click on the file "Engine.log" that has "Engine::receiveAnalysisMessage:" (usually Engine 1), copy the content between the { and }. Be sure to use single quotes (') when supplying this string.

Value

A list containing options of the analysis. If source is a .jasp file with multiple analyses, then a list of lists. If source is the name of the R function of the analysis then all default options have been filled in and booleans set to FALSE. The options that have no default are left empty.

Examples

jaspOptions <- analysisOptions("~/Documents/someFile.jasp")
options <- jaspOptions[[1]] # if there are multiple analyses in the .jasp files you need to select one

options <- analysisOptions("BinomialTest")
options[["variables"]] <- "contBinom"

# Above and below are identical (below is taken from the Qt terminal)

options <- analysisOptions('{
"dynamicModuleCall" : "",
"id" : 1,
"jaspResults" : true,
"name" : "BinomialTest",
"options" : {
 ".meta" : {
   "variables" : {
     "containsColumn" : true
   }
 },
 "VovkSellkeMPR" : false,
 "confidenceInterval" : false,
 "confidenceIntervalInterval" : 0.950,
 "descriptivesPlots" : false,
 "descriptivesPlotsConfidenceInterval" : 0.950,
 "hypothesis" : "notEqualToTestValue",
 "plotHeight" : 320,
 "plotWidth" : 480,
 "testValue" : "0.5",
 "variables" : [ "contBinom" ]
},
"perform" : "run",
"revision" : 0,
"rfile" : "",
"title" : "Binomial Test",
"typeRequest" : "analysis"
}')


jasp-stats/jasptools documentation built on Feb. 19, 2024, 11:28 a.m.