R version 4.4.0 RC (2024-04-16 r86468 ucrt) -- "Puppy Cup" 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) > > > ## egf_link_get #################################################### > ## egf_link_add #################################################### > ## egf_link_remove #################################################### > ## egf_link_extract #################################################### > > x0 <- egf_top(NULL, link = FALSE) > x1 <- egf_link_add(x0) > link <- egf_link_get(x0) > > identical(link, ifelse(x0 == "p", "logit", "log")) [1] TRUE > identical(egf_link_get("invalid name"), NA_character_) [1] TRUE > identical(egf_link_get("log(r)"), NA_character_) [1] TRUE > > identical(x1, sprintf("%s(%s)", link, x0)) [1] TRUE > identical(egf_link_add("invalid name"), NA_character_) [1] TRUE > identical(egf_link_add("log(r)"), NA_character_) [1] TRUE > > identical(egf_link_remove(x1), x0) [1] TRUE > identical(egf_link_remove("invalid name"), NA_character_) [1] TRUE > identical(egf_link_remove("r"), NA_character_) [1] TRUE > > identical(egf_link_extract(x1), link) [1] TRUE > identical(egf_link_extract("invalid name"), NA_character_) [1] TRUE > identical(egf_link_extract("r"), NA_character_) [1] TRUE > > > ## egf_link_match ###################################################### > > identical(egf_link_match("identity"), identity) [1] TRUE > identical(egf_link_match("log"), log) [1] TRUE > identical(egf_link_match("logit"), qlogis) [1] TRUE > assertError(egf_link_match("invalid name")) > > identical(egf_link_match("identity", inverse = TRUE), identity) [1] TRUE > identical(egf_link_match("log", inverse = TRUE), exp) [1] TRUE > identical(egf_link_match("logit", inverse = TRUE), plogis) [1] TRUE > assertError(egf_link_match("invalid name", inverse = TRUE)) > > > ## egf_top ############################################################# > > x1 <- NULL > x2 <- egf_model() > x3 <- list(model = x2) > class(x3) <- "egf" > > s1 <- egf_top(x1, link = FALSE) > s2 <- egf_top(x2, link = FALSE) > s3 <- egf_top(x3, link = FALSE) > > stopifnot(exprs = { + is.character(s1) + length(s1) > 0L + !anyNA(s1) + is.null(names(s1)) + + is.character(s2) + length(s2) > 0L + match(s2, s1, 0L) > 0L + + identical(s3, s2) + }) > > proc.time() user system elapsed 0.81 0.15 0.90