register: Assign new ids to data

Description Usage Arguments Value Note Examples

Description

This function reassign ids to new entities by make sure that none of the existing entities' ids in x are duplicated with the new entities' ids.

Usage

1
register(x, ..., only_primary_id_col = FALSE)

Arguments

x

an Entity class object

...

a list of data.frame objects to

only_primary_id_col

:: logical(1)
Default as FALSE. Only reassign ids for the primary id column of ....

Value

a named list of data.frame objects provided in ... but with new ids assigned to them.

Note

The output of this function is a named list of the data.frame objects provided in .... Where the names of the data.frames are the variable names that were given in .... For example, if you call data_lst <- (Ind, new_ind_data) then the output would be a named list of length 1 where the first element is named new_ind_data. To be safe, you may want to refer to that data using the index (e.g. data_lst[[1]]).

Examples

1
2
3
4
5
6
7
create_toy_world()

Ind <- world$get("Individual")

new_ind_data <- data.table::copy(toy_individuals)

data_lst <- register(Ind, new_ind_data)

dymium-org/dymiumCore documentation built on July 18, 2021, 5:10 p.m.