w <- function(y, precision = 7) {
v <- recode2integer(y, precision)
print(v)
print(table(y, ynew = v$y))
}
set.seed(1)
w(sample(1:3, 20, TRUE))
w(sample(letters[1:3], 20, TRUE))
y <- runif(20)
w(y)
w(y, precision = 2)
Run the code above in your browser using DataLab