(ix <- interval(x <- 0:100/100, breaks = 0:10/10))
(cx <- cut(x, breaks = 0:10/10))
attr(ix, "levels")
levels(ix)
levels(cx)
diag(table(ix, cx))
(ix <- interval(x <- c(NA, 0:100/100), breaks = 0:10/10))
ix[is.na(x)]
unclass(ix)[is.na(x)]
Run the code above in your browser using DataLab