That's an interesting example, as it's conceptually similar to what
Pavel is proposing, but structurally different. gsubfn() is more
complicated than a simple switch in the body of the function, and
wouldn't work well as an anonymous function.
Multiple dispatch can nicely encompass both of these c
Thanks a lot! I can confirm that it has been fixed indeed.
Regards,
Yihui
On Mon, Feb 27, 2023 at 1:14 PM Tomas Kalibera
wrote:
>
> On 2/27/23 17:02, Yihui Xie wrote:
>
> Hi Tomas,
>
> There has been an R CMD check error with xfun and r-devel on Windows for a
> while:
> https://www.r-project.
This could be extended to sub and gsub as well which gsubfn in the
gusbfn package already does:
library(gsubfn)
gsubfn("^..", toupper, c("abc", "xyz"))
## [1] "ABc" "XYz"
On Fri, Mar 3, 2023 at 7:22 PM Pavel Krivitsky wrote:
>
> Dear All,
>
> Currently, list= in base::replace(x, list, valu
Dear Serguei,
On Mon, 2023-03-06 at 09:45 +0100, Serguei Sokol wrote:
> Right, but anonymous function syntax can palliate to this:
>
> x |> (\(x) replace(x, is.na(x), 0))()
This approach hardly makes for concise or readable code.
>
> Before modifying the base of R, we should examine existing
>