Skip to content
Prev 248102 / 398503 Next

meaning of formula in aggregate function

Den
Dear Peter
Thank you
Lo and behold
Now I've got it

In code
aggregate(.~ id, lapply(df, as.character), FUN =
function(x)paste(sort(x), collapse = ''), na.action = na.pass)

there are no contradictions with NAs.

na.action = na.pass is applied to aggregate where default is na.omit.
And afterwards those NAs are removed by sort command.

It is a lot easier for me to deal with data when I know what I am doing.
Thank you again for help. Sorry for annoying naive questions. 

With best regards
Denis Kazakiewicz
Belarus 




 ???, 23/01/2011 ? 05:38 -0800, P Ehlers ????: