R/RstoxTesting.R
compareProjectToStoredOutputFiles.Rd
Function for comparing existing output files with the memory read using runProject()
compareProjectToStoredOutputFiles(
projectPath,
projectPath_original = projectPath,
emptyStringAsNA = FALSE,
intersect.names = TRUE,
ignore.variable = NULL,
ignore.process = NULL,
ignore.process.variable = NULL,
skipNAFraction = FALSE,
skipNAAt = NULL,
NAReplacement = NULL,
ignoreEqual = FALSE,
classOf = c("first", "second"),
try = TRUE,
data.out = FALSE,
sort = TRUE,
compareReports = FALSE,
checkOutputFiles = TRUE,
returnBootstrapData = FALSE,
selection = list(),
BootstrapID = NA,
unlistSingleTable = TRUE,
tolerance = sqrt(.Machine$double.eps),
debug = FALSE,
save = FALSE,
check.columnNames_identical = FALSE,
testAllTRUE = FALSE,
...
)
The path to the StoX project, i.e., the folder of the project with the sub folders "input", "output" and "process". Can possibly be the path to a file inside the project folder.
The project holding the existing output files, defaulted to projectPath
.
Logical: If TRUE, read empty strings as NA from the stored original tables, as RstoxFramework has started writing NAs as NAs and not as empty strings.
Logical: If TRUE, compare only same named columns.
Either a vector of names of variables/columns to ignore in the comparison, or a list of such variables per process (named by the process names).
A vector of names of processes to ignore in the comparison.
A list of variables to ignore for different processes, named by the processes, e.g. list(MeanNASC = c("MinLayerDepth", "MaxLayerDepth"))
Logical: If TRUE, skip rows with more than 50 percent NAs. Can also be set to a numeric value between 0 and 1.
A vector of strings naming the columns in which NA values identifies rows to skip. If more than one variable is given and more than one of these are present in a table, all rows where at least one of the variables are NA are skipped. Note that this may reduce the number of rows and may results in diffs for that reason. Using this option is best used in combination with mergeWhenDifferentNumberOfRows
.
List of replacement values for different classes of NA, applied after any merging as to incorporate NAs generated during merging.
Logical: If TRUE, ignore columns where all values are equal.
Character string specifying whether to compare after converting to the class of the first or second table. Set this to "first" (default) to convert class to the original data.
Logical: If FALSE do not run the process in a tryCatch
. Set this to FALSE when debugging, as the tryCatch
masks the errors in the traceback
.
Logical, if TRUE output the original and new data along with the tests. data.out
= NULL implies data.out
= FALSE if no difference was found and data.out
= TRUE otherwise.
Logical, if TRUE sort the tables before all.equal. When mergeWhenDifferentNumberOfRows = TRUE the tables are always sorted.
Logical, if TRUE compare the report specifically (old method kept for robustness).
Logical, if TRUE compare the file names of the output files.
Logical: If TRUE read the content of bootstrap NetCDF4 file.
Hierarchical list of names of the groups/variables. The last element must be a vector of the variables to return from the table specified by the other elements. E.g., list("ImputeSuperIndividuals", "SuperIndividualsData", c("Stratum", "IndividualAge", "Abundance")) will return a data.table of the three columns "Stratum", "IndividualAge" and "Abundance", added the BootstrapID specified in BootstrapID
.
A sequence of bootstrap IDs, i.e., the indices of the bootstrap replicates. The default returns all bootstrap replicates.
Logical: For use when only single table process outputs are among the requested processes in OutputProcesses
of Bootstrap
. If FALSE (default) return a list named by the selection
with a sub-list named by the datatype holding the output data (e.g. $ImputeSuperIndividuals$SuperIndividualsData). If TRUE return a list named by the selection
holding the output data, replicating the output of Bootstrap
in StoX <= 3.6.2.
The tolerance to use in all.equal.
Logical: If TRUE, interrupt the execution just before priting the test results.
Logical: If TRUE save the project before closing. Default (NULL) is to ask the user whether to save the project before closing.
Logical: If TRUE, test that the column names are identical between corresponding tables of the original and new data.
Logical: If FALSE, only test differences between common rows between tables that are compared by merging. If TRUE the function reports test failures when the extra rows from merging wih all = TRUE contains differences.
Used in runModel().