R/frame.R
Compute the frame's mean by-column (or by-row).
h2o.mean(x, na.rm = FALSE, axis = 0, return_frame = FALSE, ...) # S3 method for H2OFrame mean(x, na.rm = FALSE, axis = 0, return_frame = FALSE, ...)
x | An H2OFrame object. |
---|---|
na.rm |
|
axis |
|
return_frame |
|
... | Further arguments to be passed from or to other methods. |
Returns a list containing the mean for each column (NaN for non-numeric columns) if return_frame is set to FALSE. If return_frame is set to TRUE, then it will return an H2O frame with means per column or row (depends on axis argument).
mean
, rowMeans
, or colMeans
for the base R implementation
# NOT RUN { h2o.init() prosPath <- system.file("extdata", "prostate.csv", package="h2o") prostate.hex <- h2o.uploadFile(path = prosPath) # Default behavior. Will return list of means per column. h2o.mean(prostate.hex$AGE) # return_frame set to TRUE. This will return an H2O Frame # with mean per row or column (depends on axis argument) h2o.mean(prostate.hex,na.rm=TRUE,axis=1,return_frame=TRUE) # }