new rcpp template: indent 2 spaces and use NumericVector rather than scalar