I want to do something similar of COUNTIFS and SUMIFS in R using data.table package.
Here is my data.
library(data.table)
treesData<-as.data.table(trees)
bins<-seq(63, length.out = 10, by = 3);
aggtable <- data.table(bin1 = bins[-length(bins)], bin2 = bins[-1])
This is what I want to achieve:
Count is countifs on height if it is in the interval.
and Girth.total is sum on girth.