Last modified: Mon, 06/19/2017 - 11:06
ELEMENT_INDEX_STR(A, B) Returns index value in B for each string in A. The string comparisons are case-sensitive.
Arguments: |
A |
string data |
B |
list of strings to match |
|
Result Axes: |
X |
Inherited from argument A |
Y |
Inherited from argument A |
|
Z |
Inherited from argument A |
|
T |
Inherited from argument A |
Example
(See ELEMENT_INDEX) above for a simple example of the numeric case. )
Say we have a dataset that contains a string variable called institute for a collection of stations, and station locations xloc, yloc. Use ELEMENT_INDEX_STR to draw a polygon plot where the data stations belonging to each institute is shown by a dot with a unique color for each institution.
yes? USE obsdata.nc ! contains a variable called institute yes? LET inst_names = {"NOAA", "WHOI", "FSU", "BOM"} yes? LET code = IS_ELEMENT_STR(institute, inst_names) yes? LIST institute, code X: 0.5 to 53.5 Column 1: INSTITUTE Column 2: CODE is ELEMENT_INDEX_STR(institute, {"NOAA", "FSU", "BOM", "WHOI"}) INSTITUTE CODE 1 / 1: "NOAA" 1.000 2 / 2: "WHOI" 4.000 3 / 3: "FSU" 2.000 4 / 4: "BOM" 3.000 5 / 5: "NOAA" 1.000 6 / 6: "BOM" 3.000 ... yes? GO basemap X=120:250 Y=25S:65N 20 yes? GO polymark POLY/OVER/PALETTE=rainbow_by_levels/LEV=(1,5,1) \ xloc, yloc, code, square, 0.2