row

row(x, index)

Try it yourself:

See also:

row(): Extracting a Matrix Row

row() extracts a specified row from a matrix. It is useful for selecting one observation, equation, or record while preserving its column values.

Index and shape checks

Ensure the requested index exists; indexing conventions should be verified in your expression context. Use size() to find the matrix dimensions and column() when selecting a vertical slice instead.

After extraction, use dot() for vector calculations or sum() for a row total. For modifying rather than selecting data, use subset() with explicit indices.

Try Row in Calcul.io

Start with one of the editable examples above, then replace its arguments with your own values. Keeping the function on a separate calculator line makes the input and result easy to compare. For a longer workflow, assign the result to a variable or reference that line in the next expression.

Check the shown signature before adding optional arguments, and use the related-function links to compare operations with similar purposes.

All functions