Quotes help make search much faster. Example: "Practice Makes Perfect"

Tuesday, October 22, 2013

In R, how do you create an n row by m column matrix?


Answer:

matrix(elementValues, n, m)

//this will create an n x m matrix where all elements have a value of elementValues

//if elementValues = 0 , all the elements of the n x m matrix will be 0
//if elementValues is a vector of length equal to the product of n and m, then the matrix will contain all the elements of the vector populated from top to bottom, then left to right

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts