h2o (version 2.8.4.4)

h2o.uploadFile: Upload Local Data File

Description

Uploads a file from the local drive and parses it, returning an object containing the identifying hex key.

Usage

h2o.uploadFile(object, path, key = "", parse = TRUE, header, header_with_hash, 
  sep = "", col.names, silent = TRUE, parser_type="AUTO")

Arguments

object
An H2OClient object containing the IP address and port of the server running H2O.
path
The complete URL or normalized file path of the file to be imported. Each row of data appears as one line of the file.
key
(Optional) The unique hex key assigned to the imported file. If none is given, a key will automatically be generated based on the URL path.
parse
(Optional) A logical value indicating whether the file should be parsed after import.
header
(Optional) A logical value indicating whether the first line of the file contains column headers. If left empty, the parser will try to automatically detect this.
header_with_hash
(Optional) A logical value indicating whether the first line of the file contain a column header that begins with a hash character. If left empty, the parser will try to automatically detect this.
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 H2OParsedData object containing a single delimited line with the column names for the file.
silent
(Optional) A logical value indicating whether or not to display an upload progress bar.
parser_type
(Optional) Specify the type of data to be parsed. parser_type = "AUTO" is the default, other acceptable values are "SVMLight", "XLS", and "CSV".

Value

  • If parse = TRUE, the function returns an object of class H2OParsedData. Otherwise, when parse = FALSE, it returns an object of class H2ORawData.

Details

WARNING: In H2O, import is lazy! Do not modify the data on hard disk until after parsing is complete.

See Also

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

Examples

Run this code
library(h2o)
localH2O = h2o.init()
prosPath = system.file("extdata", "prostate.csv", package = "h2o")
prostate.hex = h2o.uploadFile(localH2O, path = prosPath, key = "prostate.hex")
class(prostate.hex)
summary(prostate.hex)

Run the code above in your browser using DataLab