----- Original Message ----- From: "Peter Dalgaard" <p.dalga...@biostat.ku.dk>
To: "Steven Rytina, Prof." <steven.ryt...@mcgill.ca>
Cc: <r-help@r-project.org>
Sent: Sunday, August 09, 2009 6:35 AM
Subject: Re: [R] binary operators that implement row and column sweeps of matrices by vectors


Steven Rytina wrote:

Submitted for perusal, comment, improvements, and/or critique. The presentation is in 3 sections: motivation, code, and comment.



Motivation:



As a new-comer to R from matrix oriented Gauss and Mata, I miss the
tools for using a vector (and operator) to ‘sweep’ across a matrix.

And you have checked that this is not possible using sweep()??


That was an initial possibility, to be sure. But what was left open was how to implement imposing an arbitrary vector of suitable length and how to implement strict conformability. My take is that once one has a 'wrapper' like mine that classifies the possibilities, there is no great difference in using mapply() as I did versus, say, sweep().

   But perhaps that is in error??

On the other hand, it seems plausible that using sweep() might lead to insight into generalizations, like M dimensions swept by K. And while that would be cool it doesn't serve any practical purpose I know about.



--
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalga...@biostat.ku.dk)              FAX: (+45) 35327907

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to