Skip to contents

At present, this is just a handful of thoughts or points I thought worth recording about the development of nadir.

  • I think debugging function factories is going to be hard. How to improve the user experience with closures and function factory produced functions? It would be nice if when viewing a traceback the name of a learner like lnr_glmnet appeared on the call-stack, but instead the call stack goes from super_learner() to learners[[i]] because the learners are passed in a named list.

  • Something we might be worried about and should be careful of is that formula objects store an environment inside them. A way to see this is to call f <- y ~ x; str(f):

f <- y ~ x
str(f)
#> Class 'formula'  language y ~ x
#>   ..- attr(*, ".Environment")=<environment: R_GlobalEnv>
attr(f, '.Environment')
#> <environment: R_GlobalEnv>

Some preliminary testing has suggested that replicating a formula many times even when the environment contains large objects does not seem to increase memory usage as if the large objects contained in the environment are being replicated.

On the topic of {pkgdown}

library(devtools)
install_github('r-lib/downlit')
template:
  bootstrap: 5
  includes:
    in_header: |
      <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css" integrity="sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+" crossorigin="anonymous">
      <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js" integrity="sha384-7zkQWkzuo3B5mTepMUcHkMB5jZaolc2xDwL6VFqjFALcbeS9Ggm/Yr2r3Dy4lfFg" crossorigin="anonymous"></script>
      <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/contrib/auto-render.min.js" integrity="sha384-43gviWU0YVjaDtb/GhzOouOXtZMP/7XUzwPTstBeZFe/+rCMvRwr4yROQP43s0Xk" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
  • For now, the images in the README.Rmd are just embedded manually after having been generated (Feb 27 2025) based on the lack of support for Rmd generated images getting copied to the site docs by pkgdown discussed in this thread https://github.com/r-lib/pkgdown/issues/133 with the advice being to put images in man/figures/ so that images can also be rendered on CRAN.

  • I have tried following the advice here https://github.com/r-lib/pkgdown/issues/995 to get the articles to be in better ordering, but it didn’t seem to work for me.

  • Note that because the parallelization demo vignettes/articles/Running-super_learner-in-Parallel.Rmd uses the multicore setting, it is necessary to run pkgdown::build_article("articles/Running-super_learner-in-Parallel") from a terminal and not RStudio.

# library(nadir)