I think that there is a problem in the doc
of MASS function corresp:
man(corresp) states:
"...
Arguments:
x: The function is generic, accepting various forms of the
principal argument for specifying a two-way frequency table.
Currently accepted forms are matrices, data frames..."
Nevertheless,
> data(caith)
> caith
fair red medium dark black
blue 326 38 241 110 3
light 688 116 584 188 4
medium 343 84 909 412 26
dark 98 48 403 681 85> is.data.frame(caith)
[1] TRUE> as.matrix(caith)
fair red medium dark black
blue 326 38 241 110 3
light 688 116 584 188 4
medium 343 84 909 412 26
dark 98 48 403 681 85> corresp(as.matrix(caith))
Error in corresp.default(as.matrix(caith)) :
invalid table specification
While corresp(caith) works fine.
Is this an error in the doc or am I not
transforming into matrix in the right way?
Thanks
Dr. Agustin Lobo
Instituto de Ciencias de la Tierra (CSIC)
Lluis Sole Sabaris s/n
08028 Barcelona SPAIN
tel 34 93409 5410
fax 34 93411 0012
alobo at ija.csic.es
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 12 Nov 2001, Agustin Lobo wrote:> I think that there is a problem in the doc > of MASS function corresp:No, the problem is in R itself. Remember MASS is a port from S code, and this works as documented in S. I am fairly sure it once worked in R too. Try calling corresp.matrix directly to work around an R bug. corresp is> correspfunction (x, ...) { if (is.null(class(x))) class(x) <- data.class(x) UseMethod("corresp") } That correctly sets the class of x to "matrix", but it then dispatches corresp.default, even though corresp.matrix exists. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 12 Nov 2001, Prof Brian Ripley wrote:> > No, the problem is in R itself. Remember MASS is a port from S code, and > this works as documented in S. I am fairly sure it once worked in R too. > > Try calling corresp.matrix directly to work around an R bug.Yes, it works fine that way. Should I fill an R bug report or is this a known issue? Thanks Agus -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._