Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

H2O importFile skiping rows

Tags:

r

csv

skip

h2o

How can I skip rows while importing files?? Skip is not an available option on the h2o.importFile comand.

I have used the library h2o and the command:

h2o.importFile()
like image 660
Jesus Avatar asked Oct 29 '22 03:10

Jesus


1 Answers

The h2o.importFile() function does not provide a way of skipping rows upon import. You have a few options:

  1. Import using h2o.importFile() and then subset the frame to the rows you want. Here are some examples of how to slice rows in an H2OFrame.
  2. Import using a different package that will allow you to skip rows and then use as.h2o() to convert the data from a data.frame to an H2OFrame. As noted in the comments above, the as.h2o() function can be slow for big datasets, however, you can speed it up by installing the data.table package and setting options("h2o.use.data.table" = TRUE).

I'd recommend the first option, but you could try both and see what's faster for your dataset.

like image 58
Erin LeDell Avatar answered Nov 16 '22 13:11

Erin LeDell