col

Syntax

col(obj, index)

Arguments

obj is a vector/matrix/table.

index is an integral scalar or pair.

Details

Return a column of a vector/matrix/table. Please check related function: row.

Examples

$ x=1..6$3:2;
$ x;

#0

#1

1

4

2

5

3

6

$ col(x,0);
[1,2,3]

$ x.col(1);
[4,5,6]

$ a=table(1..3 as x,`IBM`C`AAPL as y);
$ a;

x

y

1

IBM

2

C

3

AAPL

$ a col 1;
["IBM","C","AAPL"]