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

validateR Documentation

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 class 'character'
validate(x, path = ".", validateData = TRUE, errorIfStructFalse = TRUE)

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

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.

Value

return the dmdScheme_validation object

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

## 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 )


Exp-Micro-Ecol-Hub/dmdScheme documentation built on Aug. 31, 2022, 3:17 p.m.