Hi everyone
The following behavior (in R 3.6.1 and R-devel r77040) caught me by
surprise today:
truthy <- c(TRUE, FALSE)
falsy <- c(FALSE, TRUE, FALSE)
if (truthy) "check"
#> Warning in if (truthy) "check": the condition has length > 1 and only the
#> first element will be used
#> [1] "check
NEWS for R 3.6.0:
* Experimentally, setting environment variable
_R_CHECK_LENGTH_1_LOGIC2_ will lead to warnings (or errors if the
variable is set to a ‘true’ value) when && or || encounter and use
arguments of length more than one.
> Sys.setenv("_R_CHECK_LENGTH_1_LOGIC2_" = "TRUE")
> if (FALSE |
On 19/08/2019 10:19 a.m., Kirill Müller wrote:
Hi everyone
The following behavior (in R 3.6.1 and R-devel r77040) caught me by
surprise today:
truthy <- c(TRUE, FALSE)
falsy <- c(FALSE, TRUE, FALSE)
if (truthy) "check"
#> Warning in if (truthy) "check": the condition has length > 1 and only t
Hi,
This is a long-standing bug where 'class(object)' does not
return the actual class of 'object' when used inside a validity
method. Instead it seems to return the class for which the validity
method is defined. For example:
setClass("A", slots=c(stuff="ANY"))
setValidity("A", function(o
On 8/19/19 16:23, Pages, Herve wrote:
...
> Note that this doesn't happen if A is defined as a VIRTUAL class.
To be precise, when A is a VIRTUAL class, it requires at least
one additional level of class extension to break class():
setClass("A", contains="VIRTUAL", slots=c(stuff="ANY"))
setV