1

I discretize a dataset using RWeka in R.

library(RWeka)
m2 <- Discretize(Species ~., data = iris)
View(m2)

But I want the output as an integer matrix.

For example: all the outputs of the package Discretization in R are integer matrix.

Thomas
  • 43,637
  • 12
  • 109
  • 140
clairsang
  • 125
  • 7
  • The columns are factors which in a way (read about it) are already integers. You might want to keep it that way, just learn to use factors. – flodel Feb 26 '14 at 12:10

1 Answers1

1

I suppose you're looking for as.integer:

data.frame(lapply(m2, as.integer))
Sven Hohenstein
  • 80,497
  • 17
  • 145
  • 168