From m|ch@e|ch|r|co4 @end|ng |rom gm@||@com  Mon Apr  8 19:19:29 2024
From: m|ch@e|ch|r|co4 @end|ng |rom gm@||@com (Michael Chirico)
Date: Mon, 8 Apr 2024 10:19:29 -0700
Subject: [Rd] Repeated library() of one package with different include.only=
 entries
Message-ID: <CAPRVBcy8u+2K+4Gw=FnYqt5We-qwPVuA0QDoOCmSAcqaJs1_EQ@mail.gmail.com>

Right now, attaching the same package with different include.only= has no
effect:

library(Matrix, include.only="fac2sparse")
library(Matrix)
ls("package:Matrix")
# [1] "fac2sparse"

?library does not cover this case -- what is covered is the _loading_
behavior of repeated calls:

> [library and require] check and update the list of currently attached
packages and do not reload a namespace which is already loaded

But here we're looking at the _attach_ behavior of repeated calls.

I am particularly interested in allowing the exports of a package to be
built up gradually:

library(Matrix, include.only="fac2sparse")
library(Matrix, include.only="isDiagonal") # want: ls("package:Matrix") -->
c("fac2sparse", "isDiagonal")
...

It seems quite hard to accomplish this at the moment. Is the behavior to
ignore new inclusions intentional? Could there be an argument to get
different behavior?

	[[alternative HTML version deleted]]



[Rd] Repeated library() of one package with different include.only= entries
Michael Chirico