powered by
data(N.dk)
sex
A
P
N
data(N.dk) str(N.dk) with(N.dk,addmargins(tapply(N,list(P,sex),sum),2)) with(subset(N.dk,P==max(P)),addmargins(tapply(N,list(A,sex),sum)))
Run the code above in your browser using DataLab