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.

All functions