Re: [Rd] FR: improve "use" function

2025-06-04 Thread Roland Fuß via R-devel
- 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

Re: [Rd] FR: improve "use" function

2025-06-03 Thread Kurt Hornik
> 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

Re: [Rd] FR: improve "use" function

2025-05-27 Thread Laurent Gatto via R-devel
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. >

Re: [Rd] FR: improve "use" function

2025-05-27 Thread Kurt Hornik
> 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

Re: [Rd] FR: improve "use" function

2025-05-23 Thread Trevor Davis
> 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("

[Rd] FR: improve "use" function

2025-05-23 Thread Roland Fuß via R-devel
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