Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

apollo_insertRows

Inserts rows


Description

Given a numeric object (scalar, vector, matrix or 3-dim array) inserts rows in the specified places.

Usage

apollo_insertRows(v, r, val)

Arguments

v

Numeric scalar, vector, matrix or 3-dim array.

r

Boolean vector. TRUE for inserting a row from v, FALSE to insert a new row with value val.

val

Numeric scalar. Value that will fill new rows.

Details

In general, r should be longer than the number of rows in v, and sum(r)=nrow(v). If not, then a new object with as many rows as r will be returned. Old rows will be taken from v from the top down.

Value

The same argument v but with the rows where r==FALSE removed.


apollo

Tools for Choice Model Estimation and Application

v0.2.4
GPL-2
Authors
Stephane Hess [aut], David Palma [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.