DADiSP Worksheet Functions > Function Categories > Data Manipulation and Editing > DELETECOL

 

DELETECOL

Purpose:

Deletes one or more columns from a table.

Syntax:

DELETECOL(series, columns)

series

-

A series or table.

column

-

A series of integers specifying the columns to remove.

Returns:

A series or table.

Example:

W1: ravel(1..16, 4)

W2: deletecol(W1, {2})

 

W1 contains the table:

 

{{1, 5,  9, 13},

 {2, 6, 10, 14}, 

 {3, 7, 11, 15}, 

 {4, 8, 12, 16}} 

 

W2 contains the table:

 

{{1,  9, 13},

 {2, 10, 14}, 

 {3, 11, 15}, 

 {4, 12, 16}} 

Example:

W3: deletecol(W1, {1, 4, 2})

 

W3 contains the single column series {9, 10, 11, 12}.

Remarks:

The columns to removed specified by the columns series can be in any order.

 

Values can also be deleted by assigning the empty series. For example:

 

a = ravel(1..16, 4);

a[.., 3] = {}

 

a == {{1, 5, 13},

      {2, 6, 14}, 

      {3, 7, 15}, 

      {4, 8, 16}} 

 

See DELETEROW to delete rows.

See Also:

DECIMATE

DELETE

DELETEROW

EXTRACT

INSERTCOL

MERGE

RAVEL

REMOVE

REPLACECOL