lever
lever

Reputation: 694

error in R h2o h2o.uploadFile

I am trying the tutorial from http://www.r-bloggers.com/diving-into-h2o/

I downloaded some of the airlines data locally. I am able to connect R to an H2O instance and run the demo, but I am not able to upload the airlines data successfully with an h2o function. I am not getting an error either. This is what happens:

library(data.table)
library(h2o)
localH2O = h2o.init()
DTair <- fread(pathAirline)
dim(DTair)
[1] 7009728      29
air2008.hex = h2o.uploadFile(localH2O, path = pathAirline, destination_frame  = "air2008.hex", parse = FALSE)
dim(air2008.hex)
[1] -1 -1

When I import with the fread() function, I get the data as expected. When I try to use h2o.uploadFile() I don't see any errors but the object has dimensions -1 by -1.

Any help is appreciated.

Upvotes: 2

Views: 738

Answers (2)

Erin LeDell
Erin LeDell

Reputation: 8819

The H2OConnection object (your localH2O object) is no longer supposed to be passed in to any of the uploadFile/importFile functions (it was deprecated), so you should remove argument that from the function. Also, you should use the default, parse = TRUE, if you actually want to read the data in.

Also, it is recommended to use the h2o.importFile instead of h2o.uploadFile since it is multi-threaded.

Upvotes: 2

lever
lever

Reputation: 694

The pdf documentation for h2o.uploadFile shows that all the arguments are optional except for path. I was able to successfully upload the file with:

air2008.hex = h2o.uploadFile(path = pathAirline)

Upvotes: 1

Related Questions