[R] Two ?'s:Permuting a data matrix and projection operator

Achim Zeileis zeileis at ci.tuwien.ac.at
Thu Sep 20 10:07:20 CEST 2001


"J. Wan" wrote:
> 
> Hi!
> 
> I have two questions:
> 
> 1.  Is there an easy way/algorithm to obtain a series of permutated data
> matrices which are obtained by permuting all the elements within each row?
> 
> Or is there a function that can permute all the elements for each row
> instead of the whole matrix?

sample() can do random permutations, so if you want a permutation of the
elements within each row of a matrix X, this 

t(apply(X,1,sample))

could do the job
Z


> 2.  Is there a function which helps find a matrix... projection operator
> from p dimensional to p-1 dimensional subspace orthogonal to x, a real
> number?
> 
> Thanks for your help!
> 
> **********************************************************
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list