Re: [Rd] [External] Re: zapsmall(x) for scalar x

2023-12-17 Thread Steve Martin
Sorry for being unclear. I was commenting on the edge case that Gregory brought up when calling zapsmall() with a vector of small values. I thought Gregory was asking for thoughts on that as well, but maybe I misunderstood. IMO it would be weird for zapsmall() to make a small scalar zero but not a

Re: [Rd] [External] Re: zapsmall(x) for scalar x

2023-12-17 Thread Barry Rowlingson
I think what's been missed is that zapsmall works relative to the absolute largest value in the vector. Hence if there's only one item in the vector, it is the largest, so its not zapped. The function's raison d'etre isn't to replace absolutely small values, but small values relative to the largest

Re: [Rd] zapsmall(x) for scalar x

2023-12-17 Thread Duncan Murdoch
I'm really confused. Steve's example wasn't a scalar x, it was a vector. Your zapsmall() proposal wouldn't zap it to zero, and I don't see why summary() would if it was using your proposal. Duncan Murdoch On 17/12/2023 8:43 a.m., Gregory R. Warnes wrote: Isn’t that the correct outcome? The

Re: [Rd] zapsmall(x) for scalar x

2023-12-17 Thread Gregory R. Warnes
Isn’t that the correct outcome? The user can change the number of digits if they want to see small values… -- Change your thoughts and you change the world. --Dr. Norman Vincent Peale > On Dec 17, 2023, at 12:11 AM, Steve Martin wrote: > > Zapping a vector of small numbers to zero would c