Hi, To pretty print aggregates by various dimensions I needed to add a empty row in output of aggregate. For example. d<-(aggregate(data[,cbind("x")], by=list(data$group1,data$group2), sum)) Group.1 Group.2 x 1 A N 3 2 A Y 2 3 B N 420164905 Is there a way to add an empty row between group1 and group 2. So that it looks like Group.1 Group.2 x 1 A N 3 2 A Y 2 3 4 B N 420164905 I need to format a series of aggregates by multi dimensions and I wanted to break the data by empty row between group 1 that people can see some space. Also is there a way to add subtotals by group 1 into the mix : Group.1 Group.2 x 1 A N 3 2 A Y 2 3 5 4 B N 420164905 5 420164905 original data is something like: data Group1 Group2 x A Y 1 B N 1 A Y 1 B N 420164904 A N 3
thanks Dhruv [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.