Automatically plot the associated columns in an Associative ArrayWith a lot of help from Jarmo, I got an Associative Array (aa) of columns that are linked. Next, I need to plot those, is that easily done
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;
);
);
);Automation and ScriptingRe: Automatically plot the associated columns in an Associative ArrayHow you wish to plot those?
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
);Re: Automatically plot the associated columns in an Associative ArrayJarmo
Worked great! Tweaked it a bit to allow input selection.
Thanks
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>