cartesian {BaseSet}R Documentation

Create the cartesian product of two sets

Description

Given two sets creates new sets with one element of each set

Usage

cartesian(object, set1, set2, name = NULL, ...)

## S3 method for class 'TidySet'
cartesian(
  object,
  set1,
  set2,
  name = NULL,
  keep = TRUE,
  keep_relations = keep,
  keep_elements = keep,
  keep_sets = keep,
  ...
)

Arguments

object

A TidySet object.

set1, set2

The name of the sets to be used for the cartesian product

name

The name of the new set.

...

Placeholder for other arguments that could be passed to the method. Currently not used.

keep

A logical value if you want to keep.

keep_relations

A logical value if you wan to keep old relations.

keep_elements

A logical value if you wan to keep old elements.

keep_sets

A logical value if you wan to keep old sets.

Value

A TidySet object with the new set

See Also

Other methods: TidySet-class, activate(), add_column(), add_relation(), arrange.TidySet(), complement_element(), complement_set(), complement(), element_size(), elements(), filter.TidySet(), group_by.TidySet(), group(), incidence(), intersection(), is.fuzzy(), is_nested(), move_to(), mutate.TidySet(), nElements(), nRelations(), nSets(), name_elements<-(), name_sets<-(), name_sets(), power_set(), pull.TidySet(), relations(), remove_column(), remove_element(), remove_relation(), remove_set(), rename_elements(), rename_set(), select.TidySet(), set_size(), sets(), subtract(), union()

Examples

relations <- data.frame(
    sets = c(rep("a", 5), "b"),
    elements = letters[seq_len(6)]
)
TS <- tidySet(relations)
cartesian(TS, "a", "b")

[Package BaseSet version 0.9.0 Index]