大家好,
我正在嘗試使用子集按鈕功能為控製圖創建數據表子組。 我找到了這個鏈接從交互式圖形創建子集?類似的東西,但它是針對行的。 我想改用列。 我有多個列,我正在使用帶有控製圖的列切換器。 我希望能夠在控製圖上選擇特定數據點,並且只獲取該特定列中這些點的數據。
下面是我嘗試使用的 JSL,我嘗試修改為列並失敗。
dt5= Data Table( "SPC Columns" );
colNamesList = dt5 << get Column names (string, Continuous);
gb= dt5 << Control Chart Builder(
Size( 534, 464 ),
Show Control Panel( 0 ),
Variables( Y( eval(colNamesList[1]) ) ),
Chart(
Position( 1 ),
Limits( Shade Zones( 1 ) ),
Warnings(
Test 1( 1 ),
Test 2( 1 ),
Test 3( 1 ),
Test 4( 1 ),
Test 5( 1 ),
Test 6( 1 ),
Test 7( 1 ),
Test 8( 1 )
)),
Column Switcher(colNamesList[1], Eval( colNamesList ))
);
subsetButton = Button Box( "Click to Create a Subset of Selected Points",
If( N Rows( dt5 << get selected rows ) > 0,
dt5 << subset( selected rows( 1 ), selected columns( 0 ) )
)
);
Report( gb )["Graph Builder"] << append( subsetButton );
這將為我提供在行中包含數據的所有列,當我選擇這些特定數據點時,我只想要單列數據。
感謝您的幫助,
-瑞安
你已經完成了大部分工作。 這是完成它的一種方法:
NamesDefaultToHere(1);
// Data table with some continuous columns
dt = Open("$SAMPLE_DATA/Big Class.jmp" );
colNamesList = dt << get Column names (string, Continuous);
// Control chart
gb = dt << Control Chart Builder(Show Control Panel( 0 ), Variables( Y( eval(colNamesList[1]) ) ));
// Add a column switcher
cs = gb << Column Switcher(colNamesList[1], Eval( colNamesList ));
// 'Extra' button with subset action
subsetButton = Button Box("Click to Create a Subset of Selected Points",
If( N Rows( dt << get selected rows ) > 0,
currentCol = cs << getCurrent;
dt2 = dt << subset( selected rows( 1 ), Columns(Eval(Column(dt, currentCol))));
dt2 << setName("Subset of "||(dt << getName)||" using "||currentCol);
,
Beep();
);
);
// Add this button to the control chart report (use 'topParent' so that this is not affected by any column switcher changes)
(Report(gb)[OutlineBox("Control Chart Builder")] << topParent) << append(subsetButton);