[Rd] Request: kronecker to get a sep= argument

Michael Friendly friendly at yorku.ca
Thu Nov 25 21:10:24 CET 2010


kronecker, with make.dimnames=TRUE uses a hardwired sep=":" in the line

             tmp <- outer(dnx[[i]], dny[[i]], FUN = "paste", sep = ":")

For an application in which dimnames arise from an n-way array, where 
different dimensions have
different roles, and I would like to be able to use kronecker in the form

kronecker(A, B, make.dimnames=TRUE, sep='/')

All this requires is to change the following two lines:

kronecker <- function (X, Y, FUN = "*", make.dimnames = FALSE, sep=":" ...)
{
  ...
             tmp <- outer(dnx[[i]], dny[[i]], FUN = "paste", sep = sep)
}


Otherwise, I have to reproduce the logic inside kronecker() in my 
application function.

-Michael

-- 
Michael Friendly     Email: friendly AT yorku DOT ca
Professor, Psychology Dept.
York University      Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Street    Web:   http://www.datavis.ca
Toronto, ONT  M3J 1P3 CANADA



More information about the R-devel mailing list