[Rd] removeSource() vs. function literals

2023-03-30 Thread Ivan Krylov
Dear R-devel, In a package of mine, I use removeSource on expression objects in order to make expressions that are semantically the same serialize to the same byte sequences: https://github.com/cran/depcache/blob/854d68a/R/fixup.R#L8-L34 Today I learned that expressions containing function defini

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

2023-03-30 Thread Duncan Murdoch
On 30/03/2023 10:32 a.m., Ivan Krylov wrote: Dear R-devel, In a package of mine, I use removeSource on expression objects in order to make expressions that are semantically the same serialize to the same byte sequences: https://github.com/cran/depcache/blob/854d68a/R/fixup.R#L8-L34 Today I lear

Re: [Rd] write.csv performance improvements?

2023-03-30 Thread Gabriel Becker
Hi Toby et al, On Wed, Mar 29, 2023 at 10:24 PM Toby Hocking wrote: > Dear R-devel, > I did a systematic comparison of write.csv with similar functions, and > observed two asymptotic inefficiencies that could be improved. > > 1. write.csv is quadratic time (N^2) in the number of columns N. > C

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

2023-03-30 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 application