jlCategoricalArray <- function(fa) {
as_jlvalue.factor(fa)
}
toR.CategoricalArray <- function(jlval) {
pool <- jlgetfield(jlval, "pool")
res <- jlRgetfield(jlval, "refs")
attr(res,"levels") <- jlRcall("levels", pool)
class(res) <- "factor"
res
}
levels.CategoricalArray <- function(jlval) {
jlcall("levels", jlval)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.