merge_schemas {autodb} | R Documentation |
Merge relation schemas in given pairs
Description
Generic function that merges pairs of an object's schemas with matching sets of keys. The remaining schemas contain all the attributes from the schemas merged into them.
Usage
merge_schemas(x, to_remove, merge_into, ...)
Arguments
x |
a relational schema object, such as a |
to_remove |
an integer vector, giving the indices for schemas to be merged into other schemas, then removed. |
merge_into |
an integer vector of the same length as |
... |
further arguments passed on to methods. |
Value
An R object of the same class as x
, where the relations have
been merged as indicated.
See Also
merge_empty_keys
, which is based on this function.
Examples
rs <- relation_schema(
list(
a = list(c("a", "b"), list("a")),
b = list(c("b", "c"), list("b")),
b.1 = list(c("b", "d"), list("b")),
d = list(c("d", "e"), list("d", "e"))
),
letters[1:5]
)
ds <- database_schema(
rs,
list(
list("a", "b", "b", "b"),
list("b.1", "d", "d", "d")
)
)
merge_schemas(rs, 3, 2) # merging b and b.1
merge_schemas(ds, 3, 2) # also merging their references
# merging a schema into itself just removes it
merge_schemas(rs, 3, 3)
merge_schemas(ds, 3, 3)
[Package autodb version 3.0.0 Index]