回复:考慮到它們的層次結構,如何引用具有相同名稱的輪廓框?如果您知道大綱框的確切順序,則可以使用以下命令
prf = Current Report()["Fit Group",OutlineBox(3)]<<SET title=""></SET>
或者
prf = Current Report()["Fit Group","Response A","Prediction Profiler"]<<SET title=""></SET>
回复:考慮到它們的層次結構,如何引用具有相同名稱的輪廓框?如果我想深入了解個人響應分析器,你的建議會奏效,因為我知道每個響應大綱框下只有一個。 然後我可以在參考中包含到感興趣的輪廓框的確切路徑。
但是,我特別想訪問“組”分析器,它恰好是層次結構中最高的一個,即直接在“Fit Group”大綱框下方,而不是在個人響應大綱框下方的較低級別。
問題是我不知道確切的順序,它總是不同的。不僅響應大綱框的數量,而且個別響應分析器和/或其中其他其他大綱框的存在也可能有所不同,因此我無法按編號引用它。 不幸的是,參考語法似乎不考慮層次結構,而只考慮外觀的整體順序。
雖然我感興趣的探查器也恰好是出現順序的最後一個,但這對我也沒有太大幫助,因為我不知道他們的號碼,而不是循環遍歷它們,而我已經在這樣做了。
回复:考慮到它們的層次結構,如何引用具有相同名稱的輪廓框?Xpath 或索引應該工作
Names Default To Here(1);
nw = New Window("Report",
Outline Box("Fit Group",
Outline Box( "Response A",
Outline Box("Prediction Profiler")
),
Outline Box( "Response B",
Outline Box("Prediction Profiler")
),
Outline Box( "Response C",
Outline Box("Prediction Profiler")
),
Outline Box( "Prediction Profiler" )
)
);
wait(1);
obs = nw[OutlineBox("Fit Group")] << XPath("//OutlineBox");
Right(obs, 1) << Set Title("This");
wait(1);
nw = New Window("Report",
Outline Box("Fit Group",
Outline Box( "Response A",
Outline Box("Prediction Profiler")
),
Outline Box( "Response B",
Outline Box("Prediction Profiler")
),
Outline Box( "Response C",
Outline Box("Prediction Profiler")
),
Outline Box( "Prediction Profiler" )
)
);
wait(1);
nw["Fit Group",OutlineBox(8)] << Set Title("That");回复:考慮到它們的層次結構,如何引用具有相同名稱的輪廓框?您可以使用路徑()得到所有輪廓框-- 然後你可以過濾它來勾勒出有標題的框“預測分析器”如果你想。然後你可以問每個輪廓框它的父級是什麼,並將其與頂層匹配輪廓框“適合組” .這將拉第一個輪廓框有標題“預測分析器”那是OutlineBox( "擬合組" ) .
win = New Window("Report",
Outline Box("Fit Group",
Outline Box( "Response A",
Outline Box("Prediction Profiler")
),
Outline Box( "Response B",
Outline Box("Prediction Profiler")
),
Outline Box( "Response C",
Outline Box("Prediction Profiler")
),
Outline Box( "Prediction Profiler" )
)
);
olb = win[Outline Box( "Fit Group" )]; // top-level OLB of interest
olbs = olb << XPath( "//OutlineBox" ); // ALL child OLBs, regardless of hierarchy
titles = olbs << Get Title; // Get the titles of each OLB
profilers = Loc( titles, "Prediction Profiler" ); // Find the OLB locations in the list with title "Prediction Profiler"
profiler olbs = olbs[profilers]; // Get the list of OLBs with title "Prediction Profiler"
direct child profiler loc = Contains( profiler olbs << Parent, olb ); // Location of OLBs that have the "Fit Group" OLB as the direct parent
profiler = profiler olbs[direct child profiler loc]; // First of the above list
Wait( 2 );
profiler << Set Title( "Gotcha!!" ) // change name to show that the correct OLB is referenced
回复:考慮到它們的層次結構,如何引用具有相同名稱的輪廓框?您可以使用 XPath 語言獲取 XML 樹中的特定對象。
Names Default to Here( 1 );
// set up example
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
obj = dt << Fit Group(
Fit Model(
Y( :height ),
Effects( :age, :sex ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Run(
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
age( 12, Lock( 0 ), Show( 1 ) ),
sex( "F", Lock( 0 ), Show( 1 ) )
)
),
:height << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
Parameter Estimates( 1 ), Scaled Estimates( 0 ),
Plot Actual by Predicted( 0 ), Plot Regression( 0 ),
Plot Residual by Predicted( 0 ), Plot Studentized Residuals( 0 ),
Plot Effect Leverage( 0 ), Plot Residual by Normal Quantiles( 0 ),
Box Cox Y Transformation( 0 )}
)
),
Fit Model(
Y( :weight ),
Effects( :age, :sex ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Run(
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
age( 12, Lock( 0 ), Show( 1 ) ),
sex( "F", Lock( 0 ), Show( 1 ) )
)
),
:weight << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
Parameter Estimates( 1 ), Scaled Estimates( 0 ),
Plot Actual by Predicted( 0 ), Plot Regression( 0 ),
Plot Residual by Predicted( 0 ), Plot Studentized Residuals( 0 ),
Plot Effect Leverage( 0 ), Plot Residual by Normal Quantiles( 0 ),
Box Cox Y Transformation( 0 )}
)
),
<<{Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
age( 12, Lock( 0 ), Show( 1 ) ),
sex( "F", Lock( 0 ), Show( 1 ) )
)
)}
);
// start to change title
rpt = obj << Report;
profiler = rpt << XPath( "//OutlineBox[text()='Prediction Profiler']" );
last = N Items( profiler );
profiler[last] << Set Title( "I'm here!" );回复:考慮到它們的層次結構,如何引用具有相同名稱的輪廓框?謝謝你們!
絕對比循環好。
回复:考慮到它們的層次結構,如何引用具有相同名稱的輪廓框?謝謝你們!
絕對比循環好。
回复:考慮到它們的層次結構,如何引用具有相同名稱的輪廓框?這是將原始搜索算法直譯為與 Mark 的示例一起使用的 xpath
pp =(rpt << xpath("//OutlineBox[text()='Prediction Profiler'][count(./ancestor::OutlineBox[contains(text(),'Response')])=0]"));
pp << Set Title("I'm here");
它從顯示樹的頂部搜索標題為“Predicted Profiler”的 OutlineBox,該 OutlineBox 上面還有 0 個標題包含單詞“Response”的 OutlineBox。還值得指出的是,在 Jmp 17 中,屬性面板中有一個新控件,可以為您提供任何顯示框的窗口下標或 xpath 片段。它為您提供的代碼片段不會像此處發布的某些解決方案那樣靈活,但它將是一個很好的起點

考慮到它們的層次結構,如何引用具有相同名稱的輪廓框?你好,
我已經閱讀了文檔和 RTFF-ed,但找不到解決我認為非常微不足道的問題的方法。 或者,也許我完全錯過了它,而且它是非常明顯的東西。
假設我有一份關於以下輪廓框樹結構的報告(實際上,例如具有多個響應的最小二乘擬合報告,具有更複雜的結構和附加層,但這個手動創建的示例顯示了同樣的問題):
New Window("Report",
Outline Box("Fit Group",
Outline Box( "Response A",
Outline Box("Prediction Profiler")
),
Outline Box( "Response B",
Outline Box("Prediction Profiler")
),
Outline Box( "Response C",
Outline Box("Prediction Profiler")
),
Outline Box( "Prediction Profiler" )
)
);我想訪問“組”“Prediction Profiler”(最後一個)。
但是,下面的參考返回返回第一個(響應 A 的預測刻畫器),我假設是因為它是第一個,因為它們是按出現順序編號的,而不考慮層次結構級別。
prf = Current Report()[Outline Box("Fit Group")][Outline Box("Prediction Profiler")];
Show( (prf << parent) << get title ) // check the parent - confirmation that it returns the "Response A" profiler 我目前的解決方案是遍歷所有這些並檢查它們的父名稱。 父名稱不以“Response”開頭的那個是正確的。 我有一種感覺,對於一個非常簡單的任務來說,這需要大驚小怪。
有沒有更優雅、更直接的引用方式?
謝謝
數據探索和可視化視窗