[Rd] R 4.0.4 is released

2021-02-15 Thread Peter Dalgaard
The build system rolled up R-4.0.4.tar.gz (codename "Lost Library Book") this morning. The list below details the changes in this release. You can get the source code from https://cran.r-project.org/src/base/R-4/R-4.0.4.tar.gz or wait for it to be mirrored at a CRAN site nearer to you. Binari

Re: [Rd] replicate evaluates its second argument in wrong environment

2021-02-15 Thread Hadley Wickham
This is a nice example of the motivation for tidy evaluation — since enquo() captures the environment in which the promise should be evaluated, there's no need for an additional explicit argument. library(rlang) replicate2 <- function (n, expr, simplify = "array") { exnr <- enquo(expr) sapply

Re: [Rd] replicate evaluates its second argument in wrong environment

2021-02-15 Thread David Winsemius
On 2/15/21 1:10 PM, Hadley Wickham wrote: This is a nice example of the motivation for tidy evaluation — since enquo() captures the environment in which the promise should be evaluated, there's no need for an additional explicit argument. library(rlang) replicate2 <- function (n, expr, simpli

Re: [Rd] replicate evaluates its second argument in wrong environment

2021-02-15 Thread Hadley Wickham
On Monday, February 15, 2021, David Winsemius wrote: > > On 2/15/21 1:10 PM, Hadley Wickham wrote: > >> This is a nice example of the motivation for tidy evaluation — since >> enquo() captures the environment in which the promise should be >> evaluated, there's no need for an additional explicit

[Rd] Checking multiple inheritance of S4 objects using R's C API

2021-02-15 Thread Emre Gonulates
Hi, Suppose I have the following two classes in R: setClass("Person", representation(name = "character", age = "numeric")) setClass("Employee", representation(boss = "Person"), contains = "Person") I can successfully check inheritance in base R: employee <- new("Employee", name = "Jack", age

Re: [Rd] Checking multiple inheritance of S4 objects using R's C API

2021-02-15 Thread Simon Urbanek
Emre, inherits() was designed for S3 classes and at C level only ever works for S3 classes. In S4 world you should use is(). There is no equivalent C-level API for is() so, unfortunately, you likely have to use Rf_eval() of is(x, "class"). At low-level there is R_S4_extends() which allows you