Re: [R] round() and negative digits

2011-10-11 Thread Jeff Newmiller
The source does not document intent. I, too disagree with Dr Ripley on this point. The library mechanism insists that some attempt at documentation be included with the source, for good reason. I would rather the documentation assert intent to support negative rounding values and later add the

Re: [R] round() and negative digits

2011-10-11 Thread Duncan Murdoch
On 11-10-11 7:14 PM, Rolf Turner wrote: On 11/10/11 08:17, Michael Friendly wrote: On 10/9/2011 6:18 AM, Prof Brian Ripley wrote: Sometimes it is better not to document things than try to give precise details which may get changed *and* there will be useRs who misread (and maybe even file bug

Re: [R] round() and negative digits

2011-10-11 Thread Rolf Turner
On 11/10/11 08:17, Michael Friendly wrote: On 10/9/2011 6:18 AM, Prof Brian Ripley wrote: Sometimes it is better not to document things than try to give precise details which may get changed *and* there will be useRs who misread (and maybe even file bug reports on their misreadings). The source

Re: [R] round() and negative digits

2011-10-10 Thread Michael Friendly
On 10/9/2011 6:18 AM, Prof Brian Ripley wrote: Sometimes it is better not to document things than try to give precise details which may get changed *and* there will be useRs who misread (and maybe even file bug reports on their misreadings). The source is the ultimate documentation. I can't ag

Re: [R] round() and negative digits

2011-10-09 Thread Prof Brian Ripley
On Sat, 8 Oct 2011, Duncan Murdoch wrote: On 11-10-07 5:26 PM, Carl Witthoft wrote: Just wondering here -- I tested and found to my delight that % round(325.4,-2) [1] 300 gave me exactly what I would have expected (and wanted). Since it's not explicitly mentioned in the documentation that n

Re: [R] round() and negative digits

2011-10-09 Thread Duncan Murdoch
On 11-10-09 4:00 AM, (Ted Harding) wrote: On 09-Oct-11 00:46:58, Carl Witthoft wrote: On 10/8/11 6:11 PM, (Ted Harding) wrote: Carl Witthoft's serendipitous discovery is a nice example of how secrets can be guessed by wondering "what if ... ?". So probably you don;t need to tell the secrets.

Re: [R] round() and negative digits

2011-10-09 Thread Ted Harding
On 09-Oct-11 00:46:58, Carl Witthoft wrote: > > On 10/8/11 6:11 PM, (Ted Harding) wrote: > >> Carl Witthoft's serendipitous discovery is a nice example >> of how secrets can be guessed by wondering "what if ... ?". >> So probably you don;t need to tell the secrets. >> >> Taking the "negative digi

Re: [R] round() and negative digits

2011-10-08 Thread Rolf Turner
On 09/10/11 10:39, Duncan Murdoch wrote: On 11-10-08 5:32 PM, Rolf Turner wrote: On 09/10/11 00:18, Duncan Murdoch wrote: On 11-10-07 5:26 PM, Carl Witthoft wrote: Just wondering here -- I tested and found to my delight that % round(325.4,-2) [1] 300 gave me exactly what I would have expect

Re: [R] round() and negative digits

2011-10-08 Thread Rolf Turner
On 09/10/11 00:18, Duncan Murdoch wrote: On 11-10-07 5:26 PM, Carl Witthoft wrote: Just wondering here -- I tested and found to my delight that % round(325.4,-2) [1] 300 gave me exactly what I would have expected (and wanted). Since it's not explicitly mentioned in the documentation that neg

Re: [R] round() and negative digits

2011-10-08 Thread Carl Witthoft
On 10/8/11 6:11 PM, (Ted Harding) wrote: Carl Witthoft's serendipitous discovery is a nice example of how secrets can be guessed by wondering "what if ... ?". So probably you don;t need to tell the secrets. Taking the "negative digits" to their logical extreme: round(654.321,2) # [1] 6

Re: [R] round() and negative digits

2011-10-08 Thread Ted Harding
On 08-Oct-11 21:39:07, Duncan Murdoch wrote: > On 11-10-08 5:32 PM, Rolf Turner wrote: >> On 09/10/11 00:18, Duncan Murdoch wrote: >>> On 11-10-07 5:26 PM, Carl Witthoft wrote: Just wondering here -- I tested and found to my delight that % round(325.4,-2) [1] 300 gave

Re: [R] round() and negative digits

2011-10-08 Thread Duncan Murdoch
On 11-10-08 5:32 PM, Rolf Turner wrote: On 09/10/11 00:18, Duncan Murdoch wrote: On 11-10-07 5:26 PM, Carl Witthoft wrote: Just wondering here -- I tested and found to my delight that % round(325.4,-2) [1] 300 gave me exactly what I would have expected (and wanted). Since it's not explicitl

Re: [R] round() and negative digits

2011-10-08 Thread Duncan Murdoch
On 11-10-07 5:26 PM, Carl Witthoft wrote: Just wondering here -- I tested and found to my delight that % round(325.4,-2) [1] 300 gave me exactly what I would have expected (and wanted). Since it's not explicitly mentioned in the documentation that negative 'digits' is allowed, I just wanted t

[R] round() and negative digits

2011-10-07 Thread Carl Witthoft
Just wondering here -- I tested and found to my delight that % round(325.4,-2) [1] 300 gave me exactly what I would have expected (and wanted). Since it's not explicitly mentioned in the documentation that negative 'digits' is allowed, I just wanted to ask whether this behavior is intentiona