R package for calculation of weighted statistics