Learn R Programming

poseticDataAnalysis (version 1.0.0)

IsPreorder: Checking for pre-ordering (or quasi-ordering).

Description

Checks whether the input relation is a pre-order (aka, a quasi-order), i.e. if it is reflexive and transitive.

Usage

IsPreorder(set, rel)

Value

A boolean value.

Arguments

set

A list of character strings (the names of the elements of the set, on which the binary relation is defined).

rel

A two-columns character matrix, each row comprising an element (pair) of the binary relation.

Examples

Run this code
set<-c("a", "b", "c", "d")

rel <- matrix(c(
  "a", "b",
  "c", "b",
  "b", "a",
  "d", "a",
  "c", "a",
  "d", "b",
  "a", "a",
  "b", "b",
  "c", "c",
  "d", "d"
), ncol = 2, byrow = TRUE)

chk<-IsPreorder(set, rel)

Run the code above in your browser using DataLab