Learn R Programming

h2o (version 2.4.3.11)

h2o.parseRaw: Parse Raw Data File

Description

Parses a raw data file, returning an object containing the identifying hex key.

Usage

## Default method:
h2o.parseRaw(data, key = "", header, sep = "", col.names, version = 2)

## Import to a ValueArray object:
h2o.parseRaw.VA(data, key = "", header, sep = "", col.names)

## Import to a FluidVecs object:
h2o.parseRaw.FV(data, key = "", header, sep = "", col.names)

Arguments

data
An H2ORawDataVA (version = 1) or H2ORawData (version = 2) object to be parsed.
key
(Optional) The hex key assigned to the parsed file.
header
(Optional) A logical value indicating whether the first row is the column header. If missing, H2O will automatically try to detect the presence of a header.
sep
(Optional) The field separator character. Values on each line of the file are separated by this character. If sep = "", the parser will automatically detect the separator.
col.names
(Optional) A H2OParsedDataVA (version = 1) or H2OParsedData (version = 2) object containing a single delimited line with the column names for the fil
version
(Optional) If version = 1, the file will be parsed to a ValueArray object. Otherwise, if version = 2, the file will be parsed to a FluidVecs object.

Value

  • An object of class H2OParsedDataVA (version = 1) or H2OParsedData (version = 2), representing the dataset that was parsed.

Details

Calling the method with version = 1 is equivalent to h2o.parseRaw.VA, and version = 2 is equivalent to h2o.parseRaw.FV. h2o.parseRaw.VA should only be used to parse raw data imported using h2o.importFile.VA, h2o.importFolder.VA, or one of its variants. Similarly, h2o.parseRaw.FV should only be used to parse raw data imported using h2o.importFile.FV, h2o.importFolder.FV, or one of its variants. After the raw data file is parsed, it will be automatically deleted from the H2O server.

See Also

h2o.importFile, h2o.importFolder, h2o.importHDFS, h2o.importURL, h2o.uploadFile

Examples

Run this code
library(h2o)
localH2O = h2o.init(ip = "localhost", port = 54321, startH2O = TRUE)
prosPath = system.file("extdata", "prostate.csv", package="h2o")
prostate.raw = h2o.importFile(localH2O, path = prosPath, parse = FALSE)
# Do not modify prostate.csv on disk at this point!
prostate.hex = h2o.parseRaw(data = prostate.raw, key = "prostate.hex")
# After parsing, it is okay to modify or delete prostate.csv

Run the code above in your browser using DataLab