INSERT

Purpose:

Inserts values into a series as specified by explicit indices.

Syntax:

INSERT(series, values, idxseries, insertflag)

series

-

A series, the series to insert into.

values

-

A series, the values to insert.

idxseries

-

A series of integers. Specifies the indices of the original series of where to insert the new values.

insertflag

-

Optional. An integer specifying how to insert the new values:

0:

insert before index (default)

1:

insert after index

Returns:

A series or table.

Example:

W1: 1..5

W2: insert(W1, {10, 11, 12}, {1, 3, 5})

 

W2 contains the series {10, 1, 2, 11, 3, 4, 12, 5}.

Example:

W3: insert(W1, {10, 11, 12}, {1, 3, 5}, 1)

 

W3 contains the series {1, 10, 2, 3, 11, 4, 5, 12}.

Example:

insert(1..5, 10..12, {2})

 

Returns the series {1, 10, 11, 12, 2, 3, 4, 5}.

Remarks:

As indicated by the last example, if there are fewer insertion indices than values to insert, the last insertion index is used.

 

If an index is larger than the number of points, INSERT pads the intervening values with zeros.

See Also:

DECIMATE

DELETE

EXTRACT

INSERTCOL

MERGE

OUTLIER

RAVEL

REMOVE

REPLACE

REPLACECOL