Create a new vector that is the interaction of all factors (all unique
combinations)
int <- interaction(df$V1, df$V2, df$V3, drop = T)
where drop=T ensures (depending upon usage) that it will drop combinations that
are not present.
summarize with tapply(response, int, function)
"D.Kaufmann" wrote:
> Hello there
>
> I have a data set with 3 columns as factors and several other columns as
> doubles. Now, I want to do summaries by group on this data set with these 3
> factors as group variables. There are not for each combination of the 3
> factor variables datas in the data set. Nevertheless, in the report file
> there is printed a line for each combination, even if there are no datas for
> this combination. In this case, in the report file the names of the factors
> are followed by 'NULL'. Is it possible to suppress the printing of these
> lines (I am using SPlus 2000 Professional)?
>
> Thanks for your answers.
> Daniel
>
> -------------------------------------------------------------------
> Daniel Kaufmann
> SUISAG
> Allmend
> CH-6204 Sempach, Switzerland
> Tel. +41 41 462 65 53
> Fax +41 41 462 65 49
> email: dka@suisag.ch
>
> ---------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu. To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message: unsubscribe s-news
--
Dr. M. Henry H. Stevens
Postdoctoral Associate
Department of Ecology, Evolution, & Natural Resources
14 College Farm Road
Cook College, Rutgers University
New Brunswick, NJ 08901-8551
email: hstevens@rci.rutgers.edu
phone: 732-932-9631
fax: 732-932-8746
|