回复:考虑到它们的层次结构,如何引用具有相同名称的轮廓框?如果您知道大纲框的确切顺序,则可以使用以下命令
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”开头的那个是正确的。 我有一种感觉,对于一个非常简单的任务来说,这需要大惊小怪。
有没有更优雅、更直接的引用方式?
谢谢
数据探索和可视化视窗