Skip to content
Prev 18607 / 398500 Next

matrix dimension and for loop

Dear all,

My questions are that if I have
1. Is there any other way to write this without 'for'
loop?

2. and if I don't know the dimension of x, which could
be only 1 column, how could I write the command
without using if (NCOL(x)==1), or something like that?
(in case I want to include them in my function.

Example of x is a vector.
Error in x[, j] : incorrect number of dimensions

Could anyone please help me to solve these problem? 
Thank you very much for your kindness.


Sonchawan Tamkaew 

__________________________________________________



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._