VECTOR ELM MAP - how to avoid error messages and set NA to 0?
Posted: Mon May 21, 2018 10:38 am
Hi,
When using VECTOR ELM MAP function, would it be possible to avoid the error message (due to mapping outside the range) and set those :NA: to be some value such as 0? Basically I want to "shift" the values of a subscripted constant A to a subscripted constant B, by 5 subscript units. Something like the following:
A [00] = 0.1
A [01] = 0.2
A [03] = 0.3
A [04] = 0.4
A [05] = 0.5
A [06] = 0.6
A [07] = 0.7
A [08] = 0.8
A [09] = 0.9
...
A [99] = 9.9
A [100] = 10
By using VECTOR ELM MAP, with the offset being -5, I want to have:
B [00] = 0
B [01] = 0
B [03] = 0
B [04] = 0
B [05] = 0
B [06] = 0.1
B [07] = 0.2
B [08] = 0.3
B [09] = 0.4
...
B [99] = 9.4
B [100] = 9.5
The shift works out for B [06] to B [100]. However, error messages showing "ERROR: VECTOR_ELM_MAP outside array bounds computing..." come up, and the values for B [00] to B [05] are "--" instead of 0.
It is not surprising that the error message come up, because there are no subscripts before [00]. But is it possible to somewhat suppress the error messages and assign 0 to B [00] to B [05] ?
Finally, is VECTOR ELM MAP the best method in this case? Wondering whether there is some other way that is more efficient/elegant.
Thank you so much.
When using VECTOR ELM MAP function, would it be possible to avoid the error message (due to mapping outside the range) and set those :NA: to be some value such as 0? Basically I want to "shift" the values of a subscripted constant A to a subscripted constant B, by 5 subscript units. Something like the following:
A [00] = 0.1
A [01] = 0.2
A [03] = 0.3
A [04] = 0.4
A [05] = 0.5
A [06] = 0.6
A [07] = 0.7
A [08] = 0.8
A [09] = 0.9
...
A [99] = 9.9
A [100] = 10
By using VECTOR ELM MAP, with the offset being -5, I want to have:
B [00] = 0
B [01] = 0
B [03] = 0
B [04] = 0
B [05] = 0
B [06] = 0.1
B [07] = 0.2
B [08] = 0.3
B [09] = 0.4
...
B [99] = 9.4
B [100] = 9.5
The shift works out for B [06] to B [100]. However, error messages showing "ERROR: VECTOR_ELM_MAP outside array bounds computing..." come up, and the values for B [00] to B [05] are "--" instead of 0.
It is not surprising that the error message come up, because there are no subscripts before [00]. But is it possible to somewhat suppress the error messages and assign 0 to B [00] to B [05] ?
Finally, is VECTOR ELM MAP the best method in this case? Wondering whether there is some other way that is more efficient/elegant.
Thank you so much.