Learn R Programming

h2o (version 3.44.0.3)

as.numeric: Convert H2O Data to Numeric

Description

Converts an H2O column into a numeric value column. If the column type is enum and you want to convert it to numeric, you should first convert it to character then convert it to numeric. Otherwise, the values may be converted to underlying factor values, not the expected mapped values.

Usage

as.numeric(x)

Arguments

x

a column from an H2OFrame data set.

Examples

Run this code
if (FALSE) {
library(h2o)
h2o.init()
prostate_path <- system.file("extdata", "prostate.csv", package = "h2o")
prostate <- h2o.uploadFile(path = prostate_path)
prostate[, 2] <- as.factor (prostate[, 2])
prostate[, 2] <- as.numeric(prostate[, 2])
}

Run the code above in your browser using DataLab