On Tue, 27 Feb 2024 13:51:25 -0800 Jeff Newmiller via R-help <r-help@r-project.org> wrote:
> The fundamental data type in Matlab is a matrix... they don't have > vectors, they have Nx1 matrices and 1xM matrices. Also known as column vectors and row vectors. :) > Vectors don't have any concept of "row" vs. "column". They do in (numerical) linear algebra. And MATLAB was written by numerical analysts for numerical analysts. :-) So they distinguish between row and column vectors. GAUSS also distinguishes between row and column vectors. R (and S) does not distinguish between row and column vectors, and is in this aspect quite unique among the groups of vector-oriented programming languages (AFAICT). But treating every vector as a column vector, together with the recycling rule, allows for the easy coding of the matrix/vector calculations that one (mostly) comes across in statistical computing. For the rare occasion when this is not true the sweep() command is provided, typically remembered once one was bitten by the lack of distinction between row and column vectors. :) Cheers, Berwin ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.