From d@v|@ @end|ng |rom r@tud|o@com  Thu Jan 24 14:56:44 2019
From: d@v|@ @end|ng |rom r@tud|o@com (Davis Vaughan)
Date: Thu, 24 Jan 2019 08:56:44 -0500
Subject: [Rd] Inconsistent documentation of the return value of .getXlevels()
Message-ID: <CABzLhzwx25RbuJaNv_Z++h9UnQWac9or8EoYx+JU8ravV50PGQ@mail.gmail.com>

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 at rstudio.com
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]]



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