Skip to content

Commit

Permalink
Update wrappers (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
boutinb authored Nov 22, 2023
1 parent 60af191 commit 6f595f8
Show file tree
Hide file tree
Showing 12 changed files with 127 additions and 10 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export(ContingencyTablesInternal)
export(ContingencyTablesBayesianInternal)
export(RegressionLogLinearInternal)
export(RegressionLogLinearBayesianInternal)
export(InformedMultinomialTestBayesian)
export(InformedBinomialTestBayesian)
export(.bayesBinomialTest)
export(.dfPointsPP)
export(.dfLinesPP)
Expand Down
58 changes: 58 additions & 0 deletions R/InformedBinomialTestBayesianWrapper.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#
# Copyright (C) 2013-2022 University of Amsterdam
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

# This is a generated file. Don't change it

InformedBinomialTestBayesian <- function(
data = NULL,
version = "0.18.2",
bayesFactorType = "BF10",
bfComparison = "encompassing",
bfVsHypothesis = "",
bridgeSamples = 1000,
descriptivesDisplay = "counts",
descriptivesPlot = FALSE,
descriptivesTable = FALSE,
factor = "",
mcmcBurnin = 500,
mcmcSamples = 5000,
models = list(list(modelName = "Model 1", syntax = "")),
plotHeight = 320,
plotWidth = 480,
posteriorPlot = FALSE,
posteriorPlotCiCoverage = 0.95,
priorCounts = list(list(levels = list(), name = "data 1", values = list()), list(levels = list(), name = "data 2", values = list())),
sampleSize = "",
seed = 1,
setSeed = FALSE,
successes = "") {

defaultArgCalls <- formals(jaspFrequencies::InformedBinomialTestBayesian)
defaultArgs <- lapply(defaultArgCalls, eval)
options <- as.list(match.call())[-1L]
options <- lapply(options, eval)
defaults <- setdiff(names(defaultArgs), names(options))
options[defaults] <- defaultArgs[defaults]
options[["data"]] <- NULL
options[["version"]] <- NULL

optionsWithFormula <- c("bfVsHypothesis", "factor", "models", "priorCounts", "sampleSize", "successes")
for (name in optionsWithFormula) {
if ((name %in% optionsWithFormula) && inherits(options[[name]], "formula")) options[[name]] = jaspBase::jaspFormula(options[[name]], data) }

return(jaspBase::runWrappedAnalysis("jaspFrequencies::InformedBinomialTestBayesian", data, options, version))
}
57 changes: 57 additions & 0 deletions R/InformedMultinomialTestBayesianWrapper.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# Copyright (C) 2013-2022 University of Amsterdam
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

# This is a generated file. Don't change it

InformedMultinomialTestBayesian <- function(
data = NULL,
version = "0.18.2",
bayesFactorType = "BF10",
bfComparison = "encompassing",
bfVsHypothesis = "",
bridgeSamples = 1000,
count = "",
descriptivesDisplay = "counts",
descriptivesPlot = FALSE,
descriptivesTable = FALSE,
factor = "",
mcmcBurnin = 500,
mcmcSamples = 5000,
models = list(list(modelName = "Model 1", syntax = "")),
plotHeight = 320,
plotWidth = 480,
posteriorPlot = FALSE,
posteriorPlotCiCoverage = 0.95,
priorCounts = list(list(levels = list(), name = "data 1", values = list())),
seed = 1,
setSeed = FALSE) {

defaultArgCalls <- formals(jaspFrequencies::InformedMultinomialTestBayesian)
defaultArgs <- lapply(defaultArgCalls, eval)
options <- as.list(match.call())[-1L]
options <- lapply(options, eval)
defaults <- setdiff(names(defaultArgs), names(options))
options[defaults] <- defaultArgs[defaults]
options[["data"]] <- NULL
options[["version"]] <- NULL

optionsWithFormula <- c("bfVsHypothesis", "count", "factor", "models", "priorCounts")
for (name in optionsWithFormula) {
if ((name %in% optionsWithFormula) && inherits(options[[name]], "formula")) options[[name]] = jaspBase::jaspFormula(options[[name]], data) }

return(jaspBase::runWrappedAnalysis("jaspFrequencies::InformedMultinomialTestBayesian", data, options, version))
}
2 changes: 1 addition & 1 deletion R/abtestbayesianWrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

ABTestBayesian <- function(
data = NULL,
version = "0.17.1",
version = "0.18.2",
bayesFactorOrder = "bestModelTop",
bayesFactorType = "BF10",
bfRobustnessPlot = FALSE,
Expand Down
4 changes: 2 additions & 2 deletions R/binomialtestWrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

BinomialTest <- function(
data = NULL,
version = "0.17.1",
version = "0.18.2",
formula = NULL,
alternative = "twoSided",
ci = FALSE,
Expand Down Expand Up @@ -53,4 +53,4 @@ BinomialTest <- function(
if ((name %in% optionsWithFormula) && inherits(options[[name]], "formula")) options[[name]] = jaspBase::jaspFormula(options[[name]], data) }

return(jaspBase::runWrappedAnalysis("jaspFrequencies::BinomialTest", data, options, version))
}
}
2 changes: 1 addition & 1 deletion R/binomialtestbayesianWrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

BinomialTestBayesian <- function(
data = NULL,
version = "0.17.1",
version = "0.18.2",
formula = NULL,
alternative = "twoSided",
bayesFactorType = "BF10",
Expand Down
2 changes: 1 addition & 1 deletion R/contingencytablesWrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

ContingencyTables <- function(
data = NULL,
version = "0.17.1",
version = "0.18.2",
formula = NULL,
byIntervalEta = FALSE,
chiSquared = TRUE,
Expand Down
2 changes: 1 addition & 1 deletion R/contingencytablesbayesianWrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

ContingencyTablesBayesian <- function(
data = NULL,
version = "0.17.1",
version = "0.18.2",
formula = NULL,
alternative = "twoSided",
bayesFactorType = "BF10",
Expand Down
2 changes: 1 addition & 1 deletion R/multinomialtestWrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

MultinomialTest <- function(
data = NULL,
version = "0.17.1",
version = "0.18.2",
count = "",
descriptivesPlot = FALSE,
descriptivesPlotCiLevel = 0.95,
Expand Down
2 changes: 1 addition & 1 deletion R/multinomialtestbayesianWrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

MultinomialTestBayesian <- function(
data = NULL,
version = "0.17.1",
version = "0.18.2",
bayesFactorType = "BF10",
count = "",
descriptivesPlot = FALSE,
Expand Down
2 changes: 1 addition & 1 deletion R/regressionloglinearWrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

RegressionLogLinear <- function(
data = NULL,
version = "0.17.1",
version = "0.18.2",
formula = NULL,
count = "",
factors = list(),
Expand Down
2 changes: 1 addition & 1 deletion R/regressionloglinearbayesianWrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

RegressionLogLinearBayesian <- function(
data = NULL,
version = "0.17.1",
version = "0.18.2",
formula = NULL,
bayesFactorType = "BF10",
count = "",
Expand Down

0 comments on commit 6f595f8

Please sign in to comment.