Re: [R] rowSums() and is.integer()

2007-11-21 Thread Prof Brian Ripley
On Wed, 21 Nov 2007, Robin Hankin wrote: > > On 21 Nov 2007, at 08:30, Prof Brian Ripley wrote: > >> On Tue, 20 Nov 2007, Tim Hesterberg wrote: >> >>> I wrote the original rowSums (in S-PLUS). >>> There, rowSums() does not coerce integer to double. >> >> Actaully, neither does R. It computes a

Re: [R] rowSums() and is.integer()

2007-11-21 Thread Robin Hankin
On 21 Nov 2007, at 08:30, Prof Brian Ripley wrote: > On Tue, 20 Nov 2007, Tim Hesterberg wrote: > >> I wrote the original rowSums (in S-PLUS). >> There, rowSums() does not coerce integer to double. > > Actaully, neither does R. It computes a double answer but does no > coercion per se. > >> Ho

Re: [R] rowSums() and is.integer()

2007-11-21 Thread Prof Brian Ripley
On Tue, 20 Nov 2007, Tim Hesterberg wrote: > I wrote the original rowSums (in S-PLUS). > There, rowSums() does not coerce integer to double. Actaully, neither does R. It computes a double answer but does no coercion per se. > However, one advantage of coercion is to avoid integer overflow. In

Re: [R] rowSums() and is.integer()

2007-11-20 Thread Tim Hesterberg
I wrote the original rowSums (in S-PLUS). There, rowSums() does not coerce integer to double. However, one advantage of coercion is to avoid integer overflow. Tim Hesterberg >... So, why does rowSums() coerce to double (behaviour >that is undesirable for me)? __

Re: [R] rowSums() and is.integer()

2007-11-12 Thread Robin Hankin
On 10 Nov 2007, at 07:32, Prof Brian Ripley wrote: > On Fri, 9 Nov 2007, Robin Hankin wrote: > >> Hi >> >> [R-2.6.0, macOSX 10.4.10]. >> >> The helppage says that rowSums() and colSums() >> are equivalent to 'apply' with 'FUN = sum'. >> >> But I came across this: >> >> > a <- matrix(1:30,5,6) >>

Re: [R] rowSums() and is.integer()

2007-11-09 Thread Prof Brian Ripley
On Fri, 9 Nov 2007, Robin Hankin wrote: > Hi > > [R-2.6.0, macOSX 10.4.10]. > > The helppage says that rowSums() and colSums() > are equivalent to 'apply' with 'FUN = sum'. > > But I came across this: > > > a <- matrix(1:30,5,6) > > is.integer(apply(a,1,sum)) > [1] TRUE > > is.integer(rowSums(a))