From friendly at yorku.ca  Thu Nov 25 21:10:24 2010
From: friendly at yorku.ca (Michael Friendly)
Date: Thu, 25 Nov 2010 15:10:24 -0500
Subject: [Rd] Request:  kronecker to get a sep= argument
Message-ID: <4CEEC2B0.5060203@yorku.ca>

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



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