Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

For an overview, please see Vectors.


vector

...

(

...

vector

...

op

...

vector

...

)

Operation between two vectors. op is one of the operators below :

...

In all of the above operations, a missing value in one of the input vectors results in a corresponding missing value in the output vector.

 

vector

...

(

...

vector

...

op

...

number

...

)

...


vector

...

(

...

number

...

op

...

vector

...

)

Operations between vectors and numbers. op is any of the operations defined above. A missing value in either input vector will result in a missing value in the corresponding place in the output vector.

 

vector

...

(

...

vector

...

and

...

vector

...

)

...


vector

...

(

...

vector

...

or

...

vector

...

)

...


vector

...

(

...

not

...

vector

...

)

Conjunction, Disjunction and Negation. Boolean operators consider all null values to be false and all non null values to be true. The vectors created by boolean operators are binary vectors (containing only 1 where result is true, 0 where it is false). For example :

...

a

...

=

...

|1,2,3,0|

...


...

b

...

=

...

|0,5,6,7|

...


...

c

...

=

...

a

...

and

...

b

...

creates a vector c with values of 1 where the corresponding values of vector a and vector b are both non zero, and 0 otherwise. A missing value in either input vector will result in a missing value in the corresponding place in the output vector.

 

vector

...

(

...

vector

...

and

...

number

...

)

...


vector

...

(

...

number

...

or

...

vector

...

)

Boolean operations between vectors and numbers. See above. A missing value in either input vector will result in a missing value in the corresponding place in the output vector.

 

vector

...

(

...

vector

...

&

...

vector

...

&

...

...

...

)

...


vector

...

(

...

nil

...

&

...

vector

...

&

...

...

...

)

...


vector

...

(

...

vector

...

&

...

nil

...

)

...


vector

...

merge(

...

vector,vector,...

...

)

Merge several vectors. The output is a vector with as many elements as the total number of elements in all merged vectors. Merging with the value nil does nothing, and is used to initialise when building a vector from nothing.

 

vector

...

vector[number]

...


vector

...

vector[number,number]

...


vector

...

vector[number,number,number]

...


vector

...

vector[number,number,number,number]

...

Extract a selection of elements from a vector. If one parameter is given, only one element is selected. If two parameters are given, the elements ranging from the first to the last index are returned. The optional third parameter represents an increment n - every nth element from the first to the last index are returned. The optional fourth parameter specifies how many elements to take each time.

...

#

...

copies

...

fields

...

1,

...

5,

...

9,

...

13,

...

17

...

of

...

x

...

into

...

y

...


...

Y

...

=

...

X[1,20,4]

 

vector abs( vector )

Returns the vector of the absolute value of the input vector at each element. Missing values are retained, unaltered by the calculation.

...

Returns the vector of the exponential of the input vector at each element. Missing values are retained, unaltered by the calculation.


vector
 filter( vector,vector )

Takes two vectors, and returns a new vector containing only the values of the first vector where the second vector's values are non-zero and non-missing. Examples:

 

v1 = filter(v, v>273.15) # returns only the values above 273.15
v2 = filter(v, v <> vector_missing_value) # returns only the non-missing values

 

vector int( vector )

Returns the vector of the integer part of the input vector at each element. Missing values are retained, unaltered by the calculation.

...