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))
[1] FALSE
 >


so rowSums() returns a float.

Why is this?


--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to