

> Can someone please tell me what is up with na.action in aggregate? The entire row of data when it encounters a missing value, while the na.rm=TRUEĪrgument will remove missing values separately from each variable.) (The subtle distinction between na.action=na.omitĪnd na.rm=TRUE is the function you're calling is that na.omit will remove See the effect of na.action=na.pass is when you call a function that won't If you pass that to a function with the na.rm=TRUE argument, thatįunction will remove the missing values as it should. It will remove all rows from the specified data frame that have any missing Passed to your function, so you might see messages like this:Įrror in sum(1:10, na.action = na.omit) :Įrror in sum(1:10, na.action = "na.omit") :Īs far as na.action goes, when you're using the aggregate formula method,

Is a vector or data frame, it gets picked up by the. So if you pass an na.action= argument to aggregate when the first argument To aggregate, or the data frame method are described like this:Īggregate(x, by, FUN. The default method, which will be called if you pass a vector Now let's take a close look at the help page for aggregate. So when you try to use it in an R-2.10.1 it won't work. Pretty recently (I think R-2.11.1, but I might be wrong) Since the formula interface to aggregate was introduced Let me try to address your concerns one at a time: Next message: aggregate function - na.action.Previous message: aggregate function - na.action.

Aggregate function - na.action Phil Spector spector at
