Skip to content

Bug in loglin with variable called "c" (PR#198)

1 message · Brian Ripley

#
Summary:

loglin will fail if there is a global variable called c. I have
fixed this for 0.64.2 and 0.65.
On Sat, 22 May 1999, Cor en Aylin wrote:

            
Could you give version numbers in such reports please: at the moment there
is an official version (5.3pl037) of MASS for R, plus a pre-release of MASS
for V&R3, and you seem to be using the latter.  That is _not_ the most
recent port:  it is a different major version (6.1 not 5.3) and please
don't use it unless you like testing pre-release software. BTW, the name is
MASS, not mass or Mass: it is an acronym.
The problem is not in MASS: it is occurring in the R version of loglin.

To reproduce this I have to have a global variable c, not a column c in
the dataframe. So that is the workaround: make your variables columns in 
mydata. Here is a example:

library(MASS)
data(quine)
c <- quine$Eth
loglm(Days ~ .^2, quine)

To fix this in R, the line in loglin needs to be lapply(y, "c", x[i]).

Kurt: do you want explicitly to get c() from package:base here, to be
safer, or would that be too restrictive?