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

From: Michael Friendly <friendly_at_yorku.ca>
Date: Thu, 25 Nov 2010 15:10:24 -0500


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

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Thu 25 Nov 2010 - 20:13:18 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 26 Nov 2010 - 07:30:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive