Here\'s a simple data frame with a missing value:
M = data.frame( Name = c(\'name\', \'name\'), Col1 = c(NA, 1) , Col2 = c(1, 1)) # Name Col1 Col2 # 1 name
If you want the formula version to be equivalent try this:
M = data.frame( Name = rep('name',5), Col1 = c(NA,rep(1,4)) , Col2 = rep(1,5)) aggregate(. ~ Name, M, function(x) sum(x, na.rm=TRUE), na.action = na.pass)