stw_check: Check steward object

Description Usage Arguments Details Value Examples

View source: R/stw_validate.R

Description

Use these function to determine the validity of a stw_dict or stw_meta object; stw_check() tells you about the object, stw_validate() additionally throws an error if warranted. To support piping, these functions return their first argument invisibly.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
stw_check(...)

## Default S3 method:
stw_check(...)

## S3 method for class 'stw_dict'
stw_check(dict, verbosity = c("error", "info", "all", "none"), ...)

## S3 method for class 'stw_meta'
stw_check(meta, verbosity = c("error", "info", "all", "none"), ...)

## S3 method for class 'stw_dataset'
stw_check(dataset, verbosity = c("error", "info", "all"), ...)

stw_validate(...)

## Default S3 method:
stw_validate(...)

## S3 method for class 'stw_dict'
stw_validate(dict, verbosity = c("error", "info", "all"), ...)

## S3 method for class 'stw_meta'
stw_validate(meta, verbosity = c("error", "info", "all"), ...)

## S3 method for class 'stw_dataset'
stw_validate(dataset, verbosity = c("error", "info", "all"), ...)

Arguments

...

other arguments (not used)

dict

Object with S3 class stw_dict, contains data-dictionary

verbosity

character, determines the amount of feedback, see Details.

meta

Object with S3 class stw_meta, contains meta-data

dataset

Object with S3 class stw_dataset, a data frame with attached meta-data

Details

You can specify the verbosity:

"error"

reports results of all checks that failed

"info"

reports results of all checks that failed, and that find missing optional information

"all"

reports results of all checks

"none"

reports no results

The "none" option may not seem intuitive, it is for internal use. These functions set an internal attribute of the object to inicate its validity.

For a stw_dict object, each name nust be unique and non-trivial, each description must be non-trivial, type is optional.

For a stw_meta object, it must have a non-trivial name, and dict. It may have a title, description, source, n_row, and n_col.

Value

modified copy of dict or meta

Examples

1

uncoast-unconf/steward documentation built on Jan. 7, 2021, 10:38 a.m.