Learn R Programming

dmdScheme (version 1.3.5)

validate: Generic function to validate an object which represents a dmdScheme

Description

This function validates an object representing a dmdScheme. The result can be used as a basis for a report by running report() on the resultiung object of class dmdScheme_validation.

Usage

validate(x, path = ".", validateData = TRUE, errorIfStructFalse = TRUE)

# S3 method for character validate(x, path = ".", validateData = TRUE, errorIfStructFalse = TRUE)

# S3 method for dmdSchemeSet_raw validate(x, path = ".", validateData = TRUE, errorIfStructFalse = TRUE)

Value

return the dmdScheme_validation object

Arguments

x

object referring to a dmdScheme to be validatedof class dmdSchemeSet_raw as returned from read_excel( keepData = FALSE, raw = TRUE) or file name of an xlsx file containing the metadata.

path

path to the data files

validateData

if TRUE data is validated as well; the structure is always validated

errorIfStructFalse

if TRUE an error will be raised if the schemes are not identical, i.e. there are structural differences.

Methods (by class)

  • validate(character): validate a character object referring to a spreadsheet file which contains the metadata.

  • validate(dmdSchemeSet_raw): validate a dmdSchemeSet_raw object

Examples

Run this code
## validata an Excel file containing the metadata
validate(
    x = scheme_path_xlsx()
)

## validate a `dmdScheme_raw object`
validate(
   x = dmdScheme_raw()
)

## use `read_raw()` to read an Excel spreadsheet into a `dmdScheme_raw` object
x <- read_excel_raw( scheme_path_xlsx() )
validate( x = x )

Run the code above in your browser using DataLab