combine: Combines objects

View source: R/gr_combine.R

combineR Documentation

Combines objects

Description

It is designed to combine objects from classes RootDepSet for instance an object of class Neighborhood and an object of class FlowConnect. For instance if for in one of the objects we have root a with subset (a,b,c) and in the second object for root a we have subset (a,b,d,e) then applying combine will create for root a a subset (a,b).

Usage

combine(obj, ...)

## S3 method for class 'Set'
combine(obj, ...)

Arguments

obj

Object of class Set

...

lists that are going to be combined

Value

An object of class RootDepSet with two slots $value which contains subsets on the node set and slot $root containing the respective roots for ecevy subset.

Examples

# using two sets of class \code{RootDepSet}
rds1<- RootDepSet()
rds1<- setRootDepSet(rds1, list(a=letters[1:3], b=letters[1:4]), root=c("a", "b"))
rds2<- RootDepSet()
rds2<- setRootDepSet(rds2, list(a=letters[1:7], c=letters[2:5]), root=c("a", "c"))
myset<- Set()
combine(myset, rds1, rds2)

# using lists with structure that imitates the one of class RootDepSet
list1<- list(value=list(a=letters[1:5], b=letters[1:4]), root=NULL)
list2<- list(value=list(a=letters[1:7], b=letters[2:5]), root=NULL)
myset<- Set()
combine(myset, list1, list2)

gremes documentation built on Feb. 16, 2023, 8:06 p.m.