Tracciare automaticamente le colonne associate in un array associativoCon un sacco di aiuto da Jarmo, ho ottenuto un Array Associativo (aa) di colonne collegate. Poi, devo tracciare il grafico, è facile farlo?
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;
);
);
);Automazione e scriptingRe: Tracciare automaticamente le colonne associate in un array associativoCome desideri tracciarli?
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: Tracciare automaticamente le colonne associate in un array associativoJarmo
Ha funzionato alla grande! L'ho modificato un po' per consentire la selezione dell'input.
Grazie
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>