自動繪製關聯數組中的關聯列在 Jarmo 的大力幫助下,我得到了一個連結列的關聯數組 (aa)。接下來,我需要繪製這些,這很容易做到嗎
Names Default To Here(1);
startchar1 = "VT";
startchar2 = "ID";
rgx_startchar1 = Eval Insert("^startchar1^(.+?)$");
dt = Current Data Table();
collist = dt << get column names(string);
VT_IDcols = {};
For( i = 1, i <= N Items( collist ), i++,
If( !Contains( collist[i], "Pass/Fail"), If( Contains( collist[i], "VT") | Contains( collist[i], "ID") , Insert Into( VT_IDcols, collist[i] ))));
aa = Associative Array();
For Each({colname}, VT_IDcols,
col_ptrn = Regex(colname, rgx_startchar1, "\1");
If(!IsMissing(col_ptrn), // starts with VT and ends with H
If(Contains(VT_IDcols, startchar2 || col_ptrn ),
aa[startchar1 || col_ptrn] = startchar2 || col_ptrn;
);
);
);自動化和腳本回覆:自動繪製關聯數組中的關聯列您希望如何繪製這些?
Names Default To Here(1);
endchar1 = "1";
endchar2 = "2";
rgx_endchar1 = Eval Insert("(.+?)^endchar1^$");
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
collist = dt << get column names(string);
aa = Associative Array();
For Each({colname}, collist,
col_ptrn = Regex(colname, rgx_endchar1, "\1");
If(!Is Missing(col_ptrn), // ends with H
If(Contains(collist, col_ptrn || endchar2),
aa[col_ptrn || endchar1] = col_ptrn || endchar2
)
);
);
// Plotting
lub = Lineup Box(N Col(2));
For Each({{xcol, ycol}}, aa,
lub << Append(dt << Bivariate(Y(Eval(xcol)), X(Eval(ycol))));
);
nw = new window("",
lub
);回覆:自動繪製關聯數組中的關聯列賈爾莫
效果很好!稍微調整一下以允許輸入選擇。
謝謝
Names Default To Here(1);
dt = Current Data Table();
dt << Clear Column Selection();
colList = dt << get column names( string );
check_list = {"VT", "ID", "DI", "IK", "GM"};
check_list2 = {"0", "1", "2", "3", "8"};
New Window( "Select Variables",
<<TYPE></TYPE>