multivator (version 1.1-11)

compatible: Are two objects compatible?

Description

Function to detect whether two objects are compatible

Usage

compatible(x1,x2)

Value

Returns a Boolean.

Arguments

x1,x2

Two objects with names and levels. Typically either objects of class mhp or mdm.

Author

Robin K. S. Hankin

Details

Here, “compatible” means have the same names and levels. If an mdm object and mhp object are compatible, then they may be supplied to (eg) var.matrix().

The function uses identical() to compare the names and levels.

Examples

Run this code
data(mtoys)
stopifnot(compatible(toy_mhp, toy_mm))

Run the code above in your browser using DataLab