oneRow: Convenience function to get one row from a matrix or data...

View source: R/util.R

oneRowR Documentation

Convenience function to get one row from a matrix or data frame.

Description

This simply calls matrix_or_data_frame[row_index,,drop=FALSE] for you but is shorter and helps you avoid forgetting drop=FALSE. The need for drop=FALSE when selecting just one row is explained here: http://www.hep.by/gnu/r-patched/r-faq/R-FAQ_56.html

Usage

oneRow(matrix_or_data_frame, row_index)

Arguments

matrix_or_data_frame

A matrix or data frame from which you want one row.

row_index

The integer index of the row

Value

The selected row of the data frame.


jeanimal/heuristica documentation built on Feb. 3, 2024, 9:56 p.m.