Learn R Programming

disordR (version 0.9-8.2)

consistent: Check for consistency

Description

The disordR package is designed to make permitted operations transparent and to prevent forbidden operations from being executed.

Function consistent() checks for matching hash codes of its arguments and returns a Boolean. It is called by function check_matching_hash() which either returns TRUE or reports an informative error message if not.

Usage

consistent(x,y)
x %~% y
check_matching_hash(e1,e2,use=NULL)

Value

Boolean or an error as appropriate

Arguments

x,y,e1,e2

Objects of class disord

use

optional object designed to give a more intelligible error message; typically match.call()

Author

Robin K. S. Hankin

Details

Function consistent() checks that its arguments have the same hash code, and thus their elements can be paired up (e.g. added). Idiom a %~% b is equivalent to consistent(a,b).

The package generally checks for consistency with function check_matching_hash() which provides some helpful diagnostics if consistent() finds a hash mismatch.

See Also

disord

Examples

Run this code

# rdis() + rdis() # this would make check_matching_hash() report an error, if executed

Run the code above in your browser using DataLab