propagate | R Documentation |
propagate
copy columns from a given table of a list
of data.frame
to all tables based on other
common columns. If several rows are associated with the same key, the rows will be duplicated in the receiving
tables. In safe mode, the key must be unique in the original table.
propagate(db, from, add, by, safe = TRUE)
## S3 method for class 'list'
propagate(db, from, add, by, safe = TRUE)
db |
( |
from |
( |
add |
( |
by |
( |
safe |
( |
updated list
of data.frame
.
df1 <- data.frame(
id1 = c("a", "a", "c", "d", "e", "f"),
id2 = c("A", "B", "A", "A", "A", "A"),
int = c(1, 2, 3, 4, 5, 6),
bool = c(TRUE, FALSE, TRUE, FALSE, TRUE, FALSE)
)
df2 <- data.frame(
id1 = c("a", "a", "d", "e", "f", "g"),
id2 = c("A", "B", "A", "A", "A", "A")
)
df3 <- data.frame(
id1 = c("a", "c", "d", "e", "f", "x"),
id2 = c("A", "A", "A", "A", "B", "A"),
int = c(11, 22, 33, 44, 55, 66)
)
db <- list(df1 = df1, fd2 = df2, df3 = df3)
propagate(db, from = "df1", add = c("int", "bool"), by = c("id1", "id2"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.