R Under development (unstable) (2024-04-23 r86473 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. > attach(asNamespace("epigrowthfit")) > library(tools) > options(warn = 2L, error = if (interactive()) recover) > > data <- data.frame(x = 1:10, + y = letters[11:20], + z = .Date(0:9), + row.names = letters[1:10]) > > > ## egf_eval_subset ##################################################### > > stopifnot(exprs = { + identical(egf_eval_subset(quote(x > 5L), data), 6:10) + identical(egf_eval_subset(NULL, data), 1:10) + identical(egf_eval_subset(1:3, data), 1:3) + identical(egf_eval_subset(letters[4:6], data = data), 4:6) + }) > > > ## egf_eval_select ##################################################### > > stopifnot(exprs = { + identical(egf_eval_select(quote(c(x, y)), data), 1:2) + identical(egf_eval_select(quote(-x), data), 2:3) + identical(egf_eval_select(NULL, data), integer(0L)) + identical(egf_eval_select(1:2, data), 1:2) + identical(egf_eval_select(c("y", "z"), data), 2:3) + }) > > > ## egf_eval_order ###################################################### > > stopifnot(exprs = { + identical(egf_eval_order(quote(order(x, decreasing = TRUE)), data), 10:1) + identical(egf_eval_order(NULL, data), 1:10) + identical(egf_eval_order(c(1:5, 10:6), data), c(1:5, 10:6)) + }) > assertError(egf_eval_order(1:5, data)) > > > ## egf_eval_label ###################################################### > > stopifnot(exprs = { + identical(egf_eval_label(quote(paste("Date:", z)), data), + paste("Date:", data[["z"]])) + is.null(egf_eval_label(NULL, data)) + identical(egf_eval_label("1", data), rep.int("1", 10L)) + identical(egf_eval_label(1, data), rep.int("1", 10L)) + }) > > proc.time() user system elapsed 1.25 0.14 1.37