clairsang
clairsang

Reputation: 125

Discretization data numeric and convert to a integer matrix?

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.

Upvotes: 1

Views: 684

Answers (1)

Sven Hohenstein
Sven Hohenstein

Reputation: 81693

I suppose you're looking for as.integer:

data.frame(lapply(m2, as.integer))

Upvotes: 1

Related Questions