From morg@n@em@||box @end|ng |rom gm@||@com  Wed Nov 20 15:26:02 2019
From: morg@n@em@||box @end|ng |rom gm@||@com (Morgan Morgan)
Date: Wed, 20 Nov 2019 14:26:02 +0000
Subject: [Rd] Aggregate function FR
Message-ID: <CAL0QV_Pz8TJAJba5JvJJ=ey8L-+0jqt+z=GcUyNjAnFOgOFmNQ@mail.gmail.com>

Hi,

I was wondering if it would be possible to add an argument to the aggreagte
function to retain NA by categories?(default can not to in order to avoid
breaking code) Please see below example:

df = iris
df$Species[5] = NA
aggregate(`Petal.Width` ~ Species, df, sum) # does not include NA
aggregate(`Petal.Width` ~ addNA(Species), df, sum) # include NA

data.table and dplyr include NA by default.
Python pandas has an aggreagate function inspired by base R aggregate. An
option has been added to include NA.

Thank you
Best regards
Morgan

	[[alternative HTML version deleted]]



[Rd] Aggregate function FR
Morgan Morgan