- Ursprüngliche Mail -
> Von: "Kurt Hornik"
> An: "Laurent Gatto"
> CC: "Kurt Hornik" , "Trevor Davis"
> , r-devel@r-project.org, "roland
> fuss"
> Gesendet: Dienstag, 3. Juni 2025 19:23:01
> Betreff: Re: [Rd] FR: improve &quo
> Laurent Gatto writes:
Thanks.
In general, I guess we all agree that if 'include.only' or 'exclude' ask
for something (currently) impossible then a suitably classed condition
object should be thrown. Could be both a warning or an error ...
And perhaps we should take 'include.only' as 'incl
On Tuesday, May 27th, 2025 at 9:13 AM, Kurt Hornik wrote:
> > > > > > Trevor Davis writes:
>
>
> Thanks.
>
> This is really about what
>
> library("foo", include.only = "fun2")
>
> should do if package 'foo' was already attached and the include.only
> contradicts a previous specification.
>
> Trevor Davis writes:
Thanks.
This is really about what
library("foo", include.only = "fun2")
should do if package 'foo' was already attached and the include.only
contradicts a previous specification.
In principle, one could look into allowing the underlying
attachNamespace() to add mor
> Of course, it would be preferable if didn't need to detach the namespace.
Here's a version only detaches the namespace when necessary:
```r
use <- function(package, include.only) {
package <- as.character(package)[[1L]]
if (!requireNamespace(package, quietly = TRUE)) {
warning("
Hello,
Currently `use` fails silently if you try to attach functions from the
same namespace. It would be nice and more similiar to the use of
roxygen2 if it could add (and maybe even remove?) functions. Here is a
simple proof of concept I have posted on Stack Overflow [1]. Something
similar