Skip to contents

propagatecopy columns from a given table of a dm object 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.

Usage

propagate(db, from, add, by, safe = FALSE)

Arguments

db

(dm) object for which some variable need to be propagated.

from

(string) the name of the table where the variables to propagate are stored.

add

(character) the names of the variables to propagate.

by

(character) the key binding the from table to the other tables.

safe

(flag) should the key be checked for uniqueness in the from table.

Value

updates dm object.

Examples

db <- dm::dm_nycflights13()
res <- propagate(db, "airlines", "name", "carrier", safe = TRUE)
#> 
#> Skipping: airlines
#> Skipping: airports
#> Updating: flights with: name
#> Skipping: planes
#> Skipping: weather