Re: [Rd] removeSource() vs. function literals

2023-03-31 Thread Lionel Henry via R-devel
If you can afford a dependency on rlang, `rlang::zap_srcref()` deals with this. It's recursive over expression vectors, calls (including calls to `function` and their hidden srcref arg), and function objects. It's implemented in C for efficiency as we found it to be a bottleneck in some

Re: [Rd] Query: Could documentation include modernized references?

2023-03-31 Thread J C Nash
Thanks Martin. Following Duncan's advice as well as some textual input, I have put a proposed Rd file for optim on a fork of the R code at https://github.com/nashjc/r/blob/master/src/library/stats/man/optim.Rd This has the diffs given below from the github master. The suggested changes

Re: [Rd] Query: Could documentation include modernized references?

2023-03-31 Thread Martin Maechler
> Duncan Murdoch > on Sun, 26 Mar 2023 12:41:03 -0400 writes: > On 26/03/2023 11:54 a.m., J C Nash wrote: >> A tangential email discussion with Simon U. has >> highlighted a long-standing matter that some tools in the >> base R distribution are outdated, but that so

[Rd] Autocompletion for the new S3 generic @ method?

2023-03-31 Thread Karolis K
Hello, In the current R-devel @ is S3 generic, so we can do things like - for example - use it to extract matrix rows by name: .S3method("@", "mm", function(object, name) object[name,]) m <- structure(matrix(rnorm(20), ncol=2), dimnames=list(paste0("row", 1:10), paste("col", 1:2)),

Re: [Rd] removeSource() vs. function literals

2023-03-31 Thread Dénes Tóth
On 3/31/23 08:49, Lionel Henry via R-devel wrote: If you can afford a dependency on rlang, `rlang::zap_srcref()` deals with this. It's recursive over expression vectors, calls (including calls to `function` and their hidden srcref arg), and function objects. It's implemented in C for