R Under development (unstable) (2024-08-16 r87026 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 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. > suppressWarnings(RNGversion("3.5.2")) > > library("partykit") Loading required package: grid Loading required package: libcoin Loading required package: mvtnorm > set.seed(1) > > mysplit <- function(x) partysplit(1L, breaks = as.double(x)) > x <- vector(mode = "list", length = 5) > x[[1]] <- list(id = 1L, split = mysplit(1 / 3), kids = 2:3, info = "one") > x[[2]] <- list(id = 2L, info = "two") > x[[3]] <- list(id = 3L, split = mysplit(2 / 3), kids = 4:5, info = "three") > x[[4]] <- list(id = 4L, info = "four") > x[[5]] <- list(id = 5L, info = "five") > > rx <- as.partynode(x) > stopifnot(identical(as.list(rx), x)) > > dat <- data.frame(x = runif(100)) > kidids_node(rx, dat) [1] 1 2 2 2 1 2 2 2 2 1 1 1 2 2 2 2 2 2 2 2 2 1 2 1 1 2 1 2 2 2 2 2 2 1 2 2 2 [38] 1 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 1 1 1 1 2 2 2 2 1 2 1 2 1 2 2 1 2 2 2 2 2 [75] 2 2 2 2 2 2 2 2 2 1 2 1 2 1 1 1 1 1 2 2 2 2 2 2 2 2 > > proc.time() user system elapsed 0.76 0.14 0.90