[Rd] Inconsistent documentation of the return value of .getXlevels()

Davis Vaughan d@v|@ @end|ng |rom r@tud|o@com
Thu Jan 24 14:56:44 CET 2019

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? davis using rstudio.com
is the email.


# 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]]

More information about the R-devel mailing list