expect_equal_tables: Compares JASP tables in unit tests.

Description Usage Arguments Examples

View source: R/testthat-helper-tables.R

Description

This function compares a stored list of table data, to the table that is created when the tests are run.

Usage

1
expect_equal_tables(test, ref, label = NULL)

Arguments

test

The table object.

ref

The reference table list created previously by applying makeTestTable to a JASP table returned from runAnalysis.

label

Used to customise failure messages.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
options <- analysisOptions("BinomialTest")
options$variables <- "contBinom"
options$testValue <- 0.6
options$hypothesis <- "greaterThanTestValue"
options$confidenceInterval <- TRUE
options$VovkSellkeMPR <- TRUE
results <- runAnalysis("BinomialTest", "test.csv", options)
table <- results[["results"]][["binomialTable"]][["data"]]
expect_equal_tables(table,
                    list("TRUE", 1, 58, 0, 0.492841460660175, 0.696739870156555, 0.58, 100, 1, "contBinom",
                         "FALSE", 1, 42, 1, 0.336479745077558, 0.999903917924738, 0.42, 100, 1, "contBinom"))

TimKDJ/JASPTools documentation built on July 21, 2021, 7:52 p.m.