is_valid: Check validity of context and inputs/outputs

is_validR Documentation

Check validity of context and inputs/outputs

Description

Compares the input and output items to the expected values for a context and returns TRUE if the inputs/puts are valid for the provided context or an error if not. This method is used internally and not for intended for general use.

Usage

is_valid(context, input_item, input_value, output_item)

## S4 method for signature 'mw_context,character,character,character'
is_valid(context, input_item, input_value, output_item)

## S4 method for signature 'mw_moverz_context,character,character,missing'
is_valid(context, input_item, input_value)

## S4 method for signature 'mw_exactmass_context,character,character,missing'
is_valid(context, input_item, input_value)

Arguments

context

An mw_context object.

input_item

An mw_input_item object, or the name of one.

input_value

The value for the input item (character).

output_item

An mw_output_item, or the name of one.

Value

TRUE or an error.

Examples

is_valid(context$study,
  input_item$study_id$name,
  'ST000001',
  output_item$summary$name
)

computational-metabolomics/metabolomicsWorkbenchR documentation built on July 5, 2024, 10:12 a.m.