Copy Row(s) from a Dataset to Another Dataset

DESCRIPTION:

Copies a row (or rows) from a 1- or 2-dimensional dataset to another 1- or 2-dimensional dataset.

USAGE:

copy.row(target, target.start.row, source=<<see below>>, 
         source.row.spec=<<see below>>, overwrite=F, ...) 

REQUIRED ARGUMENTS:

target
1- or 2-dimensional dataset to which the row(s) will be copied. A 1-dimensional dataset is considered to be a single, unnamed column of length() rows.
target.start.row
integer or character (name-matching) value specifying the row of target to which the copy is to be done. 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.start.row will be used for the name(s) of the copied row(s).

OPTIONAL ARGUMENTS:

source
1- or 2-dimensional dataset from which the row(s) will be copied. A 1-dimensional dataset is considered to be a single, unnamed column of length() rows. The default is target.
source.row.spec
logical, integer, or character (name-matching) vector specifying the row(s) of source which is/are to be copied. To specify all rows of source, use "@ALL" or ""; to specify the last row of source, use "@END" or "". The default is "@ALL".
overwrite
logical flag: if TRUE, the existing row(s) of target will be overwritten by the copied row(s); if FALSE, all existing rows of target (if any) from target.start.row to the last row will be shifted by the number of rows as determined by source.row.spec.

VALUE:

The target dataset with the copied row(s). The name(s) of the copied row(s) will be the name(s) of the source.row.spec row(s) of source, unless overridden by target.start.row.

WARNING:

target and source must have compatible rows (the same number of columns, and the same data type in all corresonding columns); otherwise, an error will occur.

SEE ALSO:

, , , , .

EXAMPLES:

# another way to coerce fuel.frame to a data.sheet object 
fuel.sheet <- copy.row(data.sheet(), "@END", fuel.frame, "@ALL")