R function for aggregated Dataset weighted mean and SD calculation