Learn R Programming

mrf2d (version 0.3)

+,mrfi,numeric-method: Set operations for mrfi objects

Description

Provides simple operations to include (in the sense of union) new interacting positions to a mrfi object with the '+' operator and remove positions (set difference) with -. Individual positions can be included/excluded using length-2 vectors in the right hand side. Union and set difference of complete structures can also be computed by adding or subtracting two mrfi objects.

This operations deal with opposite directions filtering to avoid redundancy in the interaction structure.

Usage

# S4 method for mrfi,numeric
+(e1, e2)

# S4 method for mrfi,numeric -(e1, e2)

# S4 method for mrfi,mrfi +(e1, e2)

# S4 method for mrfi,mrfi -(e1, e2)

Arguments

e1

A mrfi object.

e2

Either a second mrfi object or a length 2 numeric with the new relative position to include (+) or remove (-).

Examples

Run this code
# NOT RUN {
mrfi(1) + c(2,0)
mrfi(1) - c(1,0)
mrfi(1) + mrfi(0, positions = list(c(2,0)))
mrfi(2) - mrfi(1)
# }

Run the code above in your browser using DataLab