Learn R Programming

h2o (version 2.8.4.4)

sum: Sum of Numeric Values

Description

Calculates the sum of all the values present in its arguments. This method extends the sum generic to deal with H2OParsedData objects.

Usage

sum(..., na.rm = FALSE)

Arguments

...
Numeric, complex, logical or H2OParsedData arguments.
na.rm
Logical value where FALSE does not remove NA's in the calculation and TRUE removes NA's in the calculation.

Value

  • Returns the sum over all the input arguments. For a H2OParsedData object, the sum is taken over all entries in the dataset. An error will occur if any of those entries is non-numeric.

Examples

Run this code
library(h2o)
localH2O = h2o.init()
ausPath = system.file("extdata", "australia.csv", package="h2o")
australia.hex = h2o.importFile(localH2O, path = ausPath, key = "australia.hex")
sum(australia.hex)
sum(c(400, 1234, -1250), TRUE, australia.hex[,1:4])

Run the code above in your browser using DataLab