From lukemolson at yahoo.com  Sat Mar 24 21:08:33 2018
From: lukemolson at yahoo.com (lmo)
Date: Sat, 24 Mar 2018 20:08:33 +0000 (UTC)
Subject: [Rd] aggregate() naming -- bug or feature
References: <1099191693.397761.1521922113450.ref@mail.yahoo.com>
Message-ID: <1099191693.397761.1521922113450@mail.yahoo.com>

Be aware that the object that aggregate returns with bar() is more complicated than you think.
str(aggregate(iris$Sepal.Length, by = list(iris$Species), FUN = bar))
'data.frame':?? ?3 obs. of? 2 variables:
?$ Group.1: Factor w/ 3 levels "setosa","versicolor",..: 1 2 3
?$ x????? : num [1:3, 1:2] 5.006 5.936 6.588 0.352 0.516 ...
? ..- attr(*, "dimnames")=List of 2
? .. ..$ : NULL
? .. ..$ : chr? "mean" "sd"
So you get a two column data.frame whose second column is a matrix.

	[[alternative HTML version deleted]]



[Rd] aggregate() naming -- bug or feature
lmo