Perhaps this would work:
spitzSum <- function(x) if(all(is.na(x))) NA else sum(x, na.rm = TRUE)
Michael
On Wed, Jan 11, 2012 at 11:18 PM, Spitzer, Matthew
wrote:
> Hello,
> I would like to please ask for assistance with aggregate sum. I have a data
> set with consisting of two grouping variab
Hello,
I would like to please ask for assistance with aggregate sum. I have a data
set with consisting of two grouping variables (id, visit) and several other
variables. I would like to sum the variables for each id and visit, but am
having problems with na.rm. na.rm=TRUE seems to replace all
2 matches
Mail list logo