I wonder if this change is intentional, and if it is, whether it is worth mentioning in the NEWS. ? R-4.1 -q -e 'intersect(list(), "foo")'
intersect(list(), "foo")
character(0) ? R-4.2 -q -e 'intersect(list(), "foo")'
intersect(list(), "foo")
list()
3 messages · Gábor Csárdi, Lluís Revilla, Martin Maechler
I wonder if this change is intentional, and if it is, whether it is worth mentioning in the NEWS. ? R-4.1 -q -e 'intersect(list(), "foo")'
intersect(list(), "foo")
character(0) ? R-4.2 -q -e 'intersect(list(), "foo")'
intersect(list(), "foo")
list()
Hi all, This change is documented on the man page so I think it is intentional.
For union, a vector of a common mode.
For intersect, a vector of a common mode, or NULL if x or y is NULL.
For setdiff, a vector of the same mode as x.
Now the results are symmetrical to intersect( "foo", list())
Probably it is worth mentioning in the NEWS as it was found to cause
some test to fail on a Bioconductor package some months ago.
This could affect other packages and analysis too.
Best,
Llu?s
I wonder if this change is intentional, and if it is, whether it is worth mentioning in the NEWS. ? R-4.1 -q -e 'intersect(list(), "foo")'
intersect(list(), "foo")
character(0) ? R-4.2 -q -e 'intersect(list(), "foo")'
intersect(list(), "foo")
list()
______________________________________________ R-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Llu?s Revilla
on Tue, 12 Apr 2022 09:16:36 +0200 writes:
> Hi all,
> This change is documented on the man page so I think it is intentional.
yes, also if you look at the (svn) log messages of the code changes
(or its git mirrors).
>> From https://search.r-project.org/R/refmans/base/html/sets.html:
> For union, a vector of a common mode.
> For intersect, a vector of a common mode, or NULL if x or y is NULL.
> For setdiff, a vector of the same mode as x.
> Now the results are symmetrical to intersect( "foo", list())
indeed, and that *is* very desirable.
> Probably it is worth mentioning in the NEWS as it was found to cause
> some test to fail on a Bioconductor package some months ago.
> This could affect other packages and analysis too.
> Best,
> Llu?s
I agree and have added an entry there ... still to be
back ported to R 4.2.0 beta.
Martin
>>
>> I wonder if this change is intentional, and if it is, whether it is
>> worth mentioning in the NEWS.
>>
>> ? R-4.1 -q -e 'intersect(list(), "foo")'
>> > intersect(list(), "foo")
>> character(0)
>>
>> ? R-4.2 -q -e 'intersect(list(), "foo")'
>> > intersect(list(), "foo")
>> list()
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel