Skip to content
Prev 17063 / 21318 Next

[Bioc-devel] sapply and vapply

FWIW,
Actually, the length of length(x) may not be 1L, e.g.
[1] 0 1
"Warning: Package authors have written methods that return a result of
length other than one (Formula) and that return a vector of type
double (Matrix), even with non-integer values (earlier versions of
sets). Where a single double value is returned that can be represented
as an integer it is returned as a length-one integer vector."

I/we recently learned this the hard way
(https://github.com/HenrikBengtsson/future/issues/395).  It's rather
unfortunate that not even length() is strictly defined here, I'd say.
I think we could move away from this if lengths() would be a generic
so lengths(x) could be used above.  But that's a discussion for
R-devel.

/Henrik


On Wed, Aug 12, 2020 at 9:33 AM Laurent Gatto
<laurent.gatto at uclouvain.be> wrote:
Message-ID: <CAFDcVCRLxJemp-awTMru2FFHwpQ5_2hbfq7p9u4BvmL5mkrh6A@mail.gmail.com>
In-Reply-To: <AM0PR03MB6195556A00BE40CB71BEA28591420@AM0PR03MB6195.eurprd03.prod.outlook.com>