dpValidateSetArgNames: dpSet and dpBatch troubleshooting fuctions

Description Usage Arguments Details Value

Description

These functions allow investigation and manipulation of arguments stored on disk. Stored arguements are used to re-load dpSet and dpBatch S3 objects into memory. Under normal use, these fuctions are not necessary; they were created during development of datapuppy for troubleshooting and fixing corrupted dpSets and dpBatchs. These functions might be useful for advanced datapuppy users. Use with caution. Before using these functions, fully understand: 1) the structure of the S3 objects; and 2) how the arguements stored on disk are used to recreate the objects are stored on disk.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
dpValidateSetArgNames(set, reportError = TRUE)

dpValidateBatchArgNames(batch, reportError = TRUE)

dpLoadSetArgList(setPath, validate = TRUE)

dpSaveSetArgList(argList, validate = TRUE)

dpLoadBatchArgList(batchPath, validate = TRUE)

dpSaveBatchArgList(argList, batchPath = NULL, validate = TRUE)

Arguments

set

A dpSet object describing the set to be operated on. Alternatively, a setPath (see 'setPath' argument in dpSet) from which the dpSet will be loaded.

reportError

Boolean value when set to TRUE creates a printed message and stops execution if the validation fails. Set to FALSE, any errors are returned in a list (see codeValue section, below.)

batch

A dpBatch object describing the batch to be operated on. Alternatively, a batchPath from which the dpBatch will be loaded.

setPath

A character string containing the path to the set directory. See dpSet for more details. If a path is not fully specified, it is assumed to be a subdirectory of the R working directory (see getwd).

validate

A boolean determining whether names in the argument list are validated against formals(dpSet) or formals(dpBatch). If TRUE, an error is thrown and execution stops when the names of the ArgList don't match.

argList

A list of arguments used to create a dpSet or dpBatch. The list is usually derived from dpLoadSetArgList() or dpLoadBatchArgList().

batchPath

A character string containing the path to the batch directory. See dpBatch for more details. If a path is not fully specified, it is assumed to be a subdirectory of the R working directory (see getwd). If NULL, the batchPath is constructed from the values expected in the argList.

Details

dpValidateSetArgNames() (dpValidateBatchArgNames) compares the names of the arguments stored on disk in the dpSet.rData (dpBatch.rData) file to the names of formals(dpSet) (formals(dpBatch)) to ensure the stored argument names are compatible with the constructor functions.

dpLoadSetArgList (dpLoadBatchArgList) allow the user to investigate the list of stored arguments. dpSaveSetArgList (dpSaveBatchArgList) save loaded argument lists back to disk, overwriting the original arguments unless a new path is specified in the argument list. Ideally, these fuctions should not be required by the end user, but they are provided for troubleshooting purposes or for altering the attributes of an existing set (batch). Use these functions with care – it would be easy to corrupt a set (batch) if you don't really understand what you are doing.

Value

dpValidateSetArgNames() (dpValidateBatchArgNames) returns a list containing two character vectors. The first vector, named "missingArguments", contains the names of arguments required by dpSet() (dpBatch()) that are missing from the stored arguments. The second vector, named "extraArguments" contains the names of any extra arguments in the stored arguments, which should be removed or renamed. When reportError is TRUE, the same information is thrown as an error and execution is stopped.

dpLoadSetArgList() returns the list of arguments that was originally passed to dpSet() to create the set. By default, the list will be validated against formals(dpSet) and an error will be thrown if the argument list doesn't match. If validate=FALSE, the function will return the loaded argument list, so that an invalid call list can be inspected or repaired.


FluvialLandscapeLab/datapuppy documentation built on May 6, 2019, 5:05 p.m.