Skip to content

Aggregation using list with Hmisc summarize function

3 messages · Muenchen, Robert A (Bob), Frank E Harrell Jr, Gabor Grothendieck

#
Muenchen, Robert A (Bob) wrote:
Use llist so summarize will know how to label the output.

Also your attach( ) is not functional as your variables are already in 
the search path.  Whenever you do need to attach, consider the use of 
with( ) instead.

Frank

  
    
#
Note that you don't really need list or llist in this case:

summarize(x, by = mydata[2:3], FUN = mean, na.rm = TRUE)

Also you could use aggregate:

aggregate(mydata[1], mydata[2:3], mean, na.rm = TRUE)
On 12/28/06, Muenchen, Robert A (Bob) <muenchen at utk.edu> wrote: