r-devel@r-project.org

2019-08-19 Thread Kirill Müller
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

r-devel@r-project.org

2019-08-19 Thread Henrik Bengtsson
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 |

r-devel@r-project.org

2019-08-19 Thread Duncan Murdoch
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

[Rd] class() bug when used within a validity method

2019-08-19 Thread Pages, Herve
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

Re: [Rd] class() bug when used within a validity method

2019-08-19 Thread Pages, Herve
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