cumlastNot

Syntax

cumlastNot(X, [k])

Please see Cumulative Window Functions (cum-functions) for the parameters and windowing logic.

Details

Return the first element of X that is not k. If k is unspecified, return the first non-NULL element.

Examples

$ x=[NULL,1,2,6,NULL,3,4,NULL]
$ cumlastNot(x);
[,1,2,6,6,3,4,4]

$ cumlastNot(x, 4)
[,1,2,6,6,3,3,3]

$ m=matrix(1 2 3 NULL 4, NULL NULL 8 8 9);
$ m;

#0

#1

1

2

3

8

8

4

9

$ cumlastNot(m);

#0

#1

1

2

3

8

3

8

4

9

Related function: lastNot