Inconsistent documentation of the return value of .getXlevels()

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Inconsistent documentation of the return value of .getXlevels()

Davis Vaughan
Hi all,

I would like to report an inconsistency in the documentation regarding
.getXlevels(). The return value states that: ".getXlevels returns a named
character vector, or NULL." This is not consistent with what is actually
returned, as seen further below in this message.

I would suggest stating: ".getXlevels returns a named list of character
vectors, or an empty named list."

I would report this directly on bugzilla, but do not have an account. Can
an R Core member here create an account for me as well? [hidden email]
is the email.

Thanks!

# Returns a named list of character vectors
mf <- model.frame(Sepal.Width ~ Species, iris)
termz <- terms(mf)
.getXlevels(termz, mf)
#> $Species
#> [1] "setosa"     "versicolor" "virginica"


# Returns an empty named list
mf2 <- model.frame(Sepal.Width ~ Sepal.Length, iris)
termz2 <- terms(mf2)
.getXlevels(termz2, mf2)
#> named list()

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel