-1

Hi I have a problem with the h2o(3) not loading my factors.

The Problem is similar to: Unable to convert data frame to h2o object

However I tried to use: myData<- data.frame(apply(myData, 2, factor, ordered=FALSE)) but the error persists: Provided column type c("ordered", "enum") is unknown.

Is there some other method to ensure that my factor is unordered?

edit

here a subset of the data

dput(droplevels(head(myData[1:5])))
structure(list(Id = structure(1:6, .Label = c("    2", "    5", 
"    6", "    7", "    8", "   10"), class = "factor"), factor1 = structure(c(1L, 
1L, 1L, 1L, 1L, 1L), .Label = "1", class = "factor"), factor2 = structure(c(3L, 
1L, 5L, 4L, 2L, 2L), .Label = c("A1", "D2", "D3", "D4", "E1"), class = "factor"), 
    factor3 = structure(c(1L, 2L, 2L, 1L, 2L, 2L), .Label = c("10", 
    "26"), class = "factor"), factor5 = structure(c(1L, 
    1L, 1L, 1L, 1L, 2L), .Label = c("2", "3"), class = "factor")), .Names = c("Id", 
"factor1", "factor2", "factor3", "factor5"
), row.names = c(NA, 6L), class = "data.frame")
> head(myData[1:5])
     Id          factor1         factor2       factor3         factor5
1     2              1             D3             10              2
2     5              1             A1             26              2
3     6              1             E1             26              2
4     7              1             D4             10              2
5     8              1             D2             26              2
6    10              1             D2             26              3
Community
  • 1
  • 1
Georg Heiler
  • 13,862
  • 21
  • 115
  • 217
  • Please make your question self-contained. Include a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and your code (including all relevant libraries). – MrFlick Nov 27 '15 at 19:56
  • I included a subset of the data – Georg Heiler Nov 27 '15 at 20:02
  • @geoHeil you did include `print` of `head` of your data, not your data. – jangorecki Nov 27 '15 at 20:04
  • Those factors *are* unordered. Compare ` str(factor(1:10))` to `str(ordered(1:10))`. Plus that's not a very friendly way to share data. A `dput()` would have been better as described in the link i provided. – MrFlick Nov 27 '15 at 20:04
  • sorry - I updated the data using dput() – Georg Heiler Nov 27 '15 at 20:12
  • That doesn't change the fact that those are called unordered factors in R. What exactly is your desired output? – MrFlick Nov 27 '15 at 20:15
  • I try to load the dataset into h2o. However I get the error from above. I try to find a workaround to make it work. Or would like to get some information from h2o which column is the one causing the error. – Georg Heiler Nov 27 '15 at 20:17

1 Answers1

0

This:

sapply(myData, class)

prints the classes of each column and helps to identify the one which is causing the errors.

I will exclude / convert that column manually.

Georg Heiler
  • 13,862
  • 21
  • 115
  • 217