The Raster Object has several summary statistics available including maximum, minimum and mean. There is no statistic for the sum of the value for the Raster variables. Please consider adding sum as a Raster object method and as a value in the new as of 3.1 computeStatistics method.