Insert Row(s) into a Dataset

DESCRIPTION:

Inserts a new row (or rows) into a 1- or 2-dimensional dataset.

USAGE:

insert.row(target, target.row, count, row.names=NULL) 

REQUIRED ARGUMENTS:

target
1- or 2-dimensional dataset into which the new row(s) will be inserted. A 1-dimensional dataset is considered to be a single, unnamed column of length() rows.
target.row
integer or character (name-matching) value specifying the row of target at which the insertion is to be done; all existing rows of target, if any, from the insertion point to the last row will be shifted by count rows. To specify the last row of target plus one, use "@END", "", or a character value not matching any of the row names of target; in the latter case, target.row will be assigned to row.names if that argument is not supplied.
count
integer value specifying the number of rows to be inserted.

OPTIONAL ARGUMENTS:

row.names
character vector specifying the name(s) for the newly inserted row(s). Default names will be generated if the length of row.names is less than count.

VALUE:

The target dataset with the newly inserted row(s).

SEE ALSO:

, , , , , , .

EXAMPLES:

# insert a new row for Acura Vigor just before Acura Legend 
car.new <- insert.row(car.all, "Acura Legend", 1, "Acura Vigor")