runAnalysis | R Documentation |
runAnalysis
makes it possible to execute a JASP analysis in R. Usually this
process is a bit cumbersome as there are a number of objects unique to the
JASP environment. Think .ppi, data-reading, etc. These (rcpp) objects are
replaced in the jaspTools so you do not have to deal with them. Note that
runAnalysis
sources JASP analyses every time it runs, so any change in
analysis code between calls is incorporated. The output of the analysis is
shown automatically through a call to view
and returned
invisibly.
runAnalysis(
name,
dataset,
options,
view = TRUE,
quiet = FALSE,
makeTests = FALSE
)
name |
String indicating the name of the analysis to run. This name is identical to that of the main function in a JASP analysis. |
dataset |
Data.frame, matrix, string name or string path; if it's a string then jaspTools first checks if it's valid path and if it isn't if the string matches one of the JASP datasets (e.g., "debug.csv"). By default the directory in Resources is checked first, unless called within a testthat environment, in which case tests/datasets is checked first. |
options |
List of options to supply to the analysis (see also
|
view |
Boolean indicating whether to view the results in a webbrowser. |
quiet |
Boolean indicating whether to suppress messages from the analysis. |
makeTests |
Boolean indicating whether to create testthat unit tests and print them to the terminal. |
options <- analysisOptions("BinomialTest")
options[["variables"]] <- "contBinom"
runAnalysis("BinomialTest", "debug", options)
# Above and below are identical (below is taken from the Qt terminal)
options <- analysisOptions('{
"id" : 6,
"name" : "BinomialTest",
"options" : {
"VovkSellkeMPR" : false,
"confidenceInterval" : false,
"confidenceIntervalInterval" : 0.950,
"descriptivesPlots" : false,
"descriptivesPlotsConfidenceInterval" : 0.950,
"hypothesis" : "notEqualToTestValue",
"plotHeight" : 300,
"plotWidth" : 160,
"testValue" : 0.50,
"variables" : [ "contBinom" ]
},
"perform" : "run",
"revision" : 1,
"settings" : {
"ppi" : 192
}
}')
runAnalysis("BinomialTest", "debug.csv", options)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.