[R] Matrix multiplication using apply() or lappy() ?

Gregor Gorjanc gregor.gorjanc at bfro.uni-lj.si
Mon Sep 11 09:57:53 CEST 2006


Jeffrey J. Hallman <jhallman <at> frb.gov> writes:
> Tim Hesterberg <timh <at> insightful.com> writes:
> 
> > toby_marks <at> americancentury.com asked:
> > >I am trying to divide the columns of a matrix by the first row in the 
> > >matrix.
> > 
> > Dividing columns of a matrix by a vector is a pretty fundamental
> > operation, and the query resulted in a large number of suggestions:
> > 
> > It is unsatisfactory when such a fundamental operation is
> > done in so many different ways.  
> > * It makes it hard to read other people's code.  
> > * Some of these are very inefficient.
>
> But since you have no way to force people to use your new 'standard'
> operators, people can and will still use any of those myriad ways you decry to
> do the same thing.  It's part of the price you pay for working with a flexible
> system. 
> 
> Besides, nothing will ever make it easy to read other people's code. 

Reading others code is never an easy task, but there are huge differences
between various "authors" and I agree with Tim, that it is nice to have some
standardized operators for common/fundamental operations. If there are standard
operators, people will use it more an more.



More information about the R-help mailing list