Learn R Programming

poseticDataAnalysis (version 1.0.0)

ReflexiveClosure: Computing reflexive closure.

Description

Computes the reflexive closure of the input binary relation.

Usage

ReflexiveClosure(set, rel)

Value

A reflexive binary relation, as a two-columns character matrix (each row comprises an element (pair) of the transitivity closed relation).

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 relation.

Examples

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

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

r.clo<-ReflexiveClosure(set, rel)

Run the code above in your browser using DataLab