Re: [R] hierachical code system

2011-11-17 Thread Albert-Jan Roskam
depth == max(df$diepte)) {     x <- getTotals(df, depth)     } else {     x <- getTotals(x, depth)     }     } Cheers!! Albert-Jan ~~ All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, wh

Re: [R] hierachical code system

2011-11-16 Thread ONKELINX, Thierry
Dear Albert-Jan, The easiest way is to create extra variables with the corresponding aggregation level. substr() en strsplit() can be your friends. Once you have those variables you can use aggregate() or any other aggregating function. You don't need loops. Best regards, Thierry > -Oors