The function takes the data and splits it into roughly equal chunks to be sent to the workers for parallel processing. The function takes care to not split the same individual across multiple workers.

split_data(db, str_id, cores)

Arguments

db

A data.frame() or tibble() containing the data

str_id

A character string giving the name of the id variable

cores

An integer indicating the number of cores to use in estimation

Value

A list of data.frames with length equal to the number of cores to use in estimation

Details

Note that the function will only split the data correctly if all respondents have the same number of rows. Therefore, it is important that this function is called after the data has been padded with NAs in case of unequal number of choice tasks.