R Under development (unstable) (2023-07-19 r84711 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > expect_equal <- function(x, y) { + stopifnot(isTRUE(all.equal(x, y))) + } > > library(reclin2) Loading required package: data.table Attaching package: 'reclin2' The following object is masked from 'package:base': identical > > # distribute_over_cluster sets the seed to ensure that for a given dataset > # the records are distributed the same way over a cluster when called > # multiple times. However we don't want to mess up the seed set by the user > # so we reset the seed. Below we check if this is done correctly > > set.seed(2) > d1 <- reclin2:::distribute_over_cluster(100, 4) > a1 <- runif(5) > d2 <- reclin2:::distribute_over_cluster(100, 4) > a2 <- runif(5) > > set.seed(2) > a1_a2 <- runif(10) > > expect_equal(c(a1, a2), a1_a2) > expect_equal(d1, d2) > > > proc.time() user system elapsed 0.25 0.09 0.32