Description Usage Arguments Value Examples
View source: R/add_relationship.R
Add a relationship to an entityset.
1 | add_relationship(entityset, parent_set, child_set, parent_idx, child_idx)
|
entityset |
The entityset to modify. |
parent_set |
The name of the parent set. |
child_set |
The name of the child set. |
parent_idx |
The index variable of the 'parent_set'. |
child_idx |
The index variable of the 'child_set'. |
A modified entityset.
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(magrittr)
set_1 <- data.frame(key = 1:100, value = sample(letters, 100, TRUE), stringsAsFactors = TRUE)
set_2 <- data.frame(key = 1:100, value = sample(LETTERS, 100, TRUE), stringsAsFactors = TRUE)
# Common variable: `key`
as_entityset(set_1, index = "key", entity_id = "set_1", id = "demo") %>%
add_entity(entity_id = "set_2", df = set_2, index = "key") %>%
add_relationship(
parent_set = "set_1",
child_set = "set_2",
parent_idx = "key",
child_idx = "key"
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.