R Under development (unstable) (2024-11-06 r87293 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. > library(mlr3data) > > stopifnotdataset = function(data) { + stopifnot( + is.data.frame(data), + colnames(data) == tolower(colnames(data)), + colnames(data) == make.names(colnames(data), unique = TRUE), + is.integer(attr(data, "row.names")) + ) + } > > data("kc_housing", package = "mlr3data") > stopifnotdataset(kc_housing) > stopifnot(nrow(kc_housing) == 21613L, ncol(kc_housing) == 20L) > > data("titanic", package = "mlr3data") > stopifnotdataset(titanic) > stopifnot(nrow(titanic) == 1309L, ncol(titanic) == 11L) > > data("optdigits", package = "mlr3data") > stopifnotdataset(optdigits) > stopifnot(nrow(optdigits) == 5620L, ncol(optdigits) == 65L) > > data("moneyball", package = "mlr3data") > stopifnotdataset(moneyball) > stopifnot(nrow(moneyball) == 1232L, ncol(moneyball) == 15L) > > > > if (requireNamespace("mlr3")) { + stopifnot(inherits(mlr3::tsk("kc_housing"), "TaskRegr")) + stopifnot(inherits(mlr3::tsk("titanic"), "TaskClassif")) + stopifnot(inherits(mlr3::tsk("optdigits"), "TaskClassif")) + stopifnot(inherits(mlr3::tsk("moneyball"), "TaskRegr")) + } Loading required namespace: mlr3 > > proc.time() user system elapsed 0.59 0.15 0.68