Compare two model data

compareModelData(
  dat_orig,
  dat,
  intersect.names = TRUE,
  ignore.variable = NULL,
  ignore.process.variable = NULL,
  skipNAFraction = FALSE,
  skipNAAt = NULL,
  NAReplacement = NULL,
  ignoreEqual = FALSE,
  classOf = c("first", "second"),
  data.out = FALSE,
  processesToCheck = NULL,
  sort = TRUE,
  compareReports = FALSE,
  checkOutputFiles = TRUE,
  tolerance = sqrt(.Machine$double.eps),
  debug = FALSE,
  check.columnNames_identical = FALSE,
  testAllTRUE = FALSE,
  ...
)

Arguments

dat_orig, dat

The original and new data to compare.

intersect.names

Logical: If TRUE, compare only same named columns.

ignore.variable

A vector of names of variables/columns to ignore in the comparison.

ignore.process.variable

A list of variables to ignore for different processes, named by the processes, e.g. list(MeanNASC = c("MinLayerDepth", "MaxLayerDepth")).

skipNAFraction

Logical: If TRUE, skip rows with more than 50 percent NAs. Can also be set to a numeric value between 0 and 1.

skipNAAt

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.

NAReplacement

List of replacement values for different classes of NA, applied after any merging as to incorporate NAs generated during merging.

ignoreEqual

Logical: If TRUE, ignore columns where all values are equal.

classOf

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.

data.out

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.

processesToCheck

Character: A vector of the names of the processes to compare.

sort

Logical, if TRUE sort the tables before all.equal. When mergeWhenDifferentNumberOfRows = TRUE the tables are always sorted.

compareReports

Logical, if TRUE compare the report specifically (old method kept for robustness).

checkOutputFiles

Logical, if TRUE compare the file names of the output files.

tolerance

The tolerance to use in all.equal.

debug

Logical: If TRUE, interrupt the execution just before priting the test results.

check.columnNames_identical

Logical: If TRUE, test that the column names are identical between corresponding tables of the original and new data.

testAllTRUE

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().