Learn R Programming

BaseSet (version 1.0.0)

cartesian: 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 TidySet cartesian( object, set1, set2, name = NULL, keep = TRUE, keep_relations = keep, keep_elements = keep, keep_sets = keep, ... )

Value

A TidySet object with the new set

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.

See Also

Other methods: TidySet-class, activate(), add_column(), add_relation(), arrange.TidySet(), complement(), complement_element(), complement_set(), element_size(), elements(), filter.TidySet(), group(), group_by.TidySet(), 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

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

Run the code above in your browser using DataLab