如何编写脚本将图表和分析数据发送到期刊,而无需手动运行现有的图表/分析脚本?你好,
我有一堆脚本,用于分析 JMP 中的产品测试数据。
脚本通常调用测试数据文件中的多个列。
每个测试运行都由一个 ID 标记,只有该 ID 发生变化才能将新的测试运行数据拉入 JMP - 用于数据分析的脚本保持不变。
为了分享我的分析,我(目前)手动创建了一个包含图表和分析数据(例如中位数和标准差等)的 PPT 幻灯片包。
我想转到 JMP 期刊。
我想知道是否有可能有一个脚本(通过自动或不运行我的其他分析脚本)将图表和分析数据发送到 JMP 日志? 如果可能的话,我能否获得一些有关示例脚本的帮助来整理这样的日记?
谢谢。
自动化和脚本编写视窗回复:如何编写脚本将图表和分析数据发送到期刊,而无需手动运行现有的图表/分析脚本?@ian_jmp - 我分解了您建议的代码以找出不起作用的内容。 看来问题出在 for 循环中的行中
thisWindow = postWindowList[w];
在我的例子中,它在日志中报告(当运行一个简单的脚本来绘制图表时)
"part012 - Graph Builder"
对于不在其中的第一个图表项目
preWindowList
然后就跑
Window(thisWindow) << Journal
不把窗口称为
"part012 - Graph Builder"
到日志文件中。 名字有问题吗“part012 - Graph Builder”本身由于该图表没有发送到期刊?
回复:如何编写脚本将图表和分析数据发送到期刊,而无需手动运行现有的图表/分析脚本?@ian_jmp ,如果我尝试以下方式,除非我注释 for 循环(在最后),否则我不会获得打开的图表窗口列表(在日志中)。
此外,不会生成日志文件。 我哪里犯了错误?
我定义一个函数(称为 getOpenWindowNames.jsl)并执行它
Names Default To Here(1);
// Returns a list containing the names of all the currently open windows in a session
namesOfOpenWindows =
Function({}, {DefaultLocal},
openWindows = Window();
openWindowNames = {};
For(w=1, w<=NItems(openWindows), w++, InsertInto(OpenWindowNames, OpenWindows[w] << GetWindowTitle));
openWindowNames;
);然后在另一个脚本中调用上述函数
Names Default To Here(1);
//Clear Symbols();
include ("getOpenWindowNames.jsl");
// Which windows are open now?
preWindowList = namesOfOpenWindows();
// Open a table
dt = Open("$SAMPLE_DATA/Big Class.jmp");
// Find out what scripts are in the table
dts = dt << GetTableScriptNames;
// Run every script
for (s=1, s<=NItems(dts), s++, dt << runScript(dts[s]));
// Which windows are open now?
postWindowList = namesOfOpenWindows();
//// Journal the contents of each 'new' window
for(w=1, w<=NItems(postWindowList), w++,
thisWindow = postWindowList[w];
if (!Contains(preWindowList, thisWindow), Window(thisWindow) << Journal);
);
回复:如何编写脚本将图表和分析数据发送到期刊,而无需手动运行现有的图表/分析脚本?@ian_jmp 。 我现在又做了一些测试。 您的脚本的这一部分不起作用。
for(w=1, w<=NItems(postWindowList), w++,
thisWindow = postWindowList[w];
if (!Contains(preWindowList, thisWindow), Window(thisWindow) << Journal);
);
脚本中上述所有内容都会给出预期结果,但前提是我注释上面的 for 循环块。
另外,我没有将图表放入日志中,因此只有看起来上面的代码似乎可以按预期工作,除非我做错了什么。
回复:如何编写脚本将图表和分析数据发送到期刊,而无需手动运行现有的图表/分析脚本?@ian_jmp 。 我正在尝试按以下方式使用您的脚本。
我编写了一个加载数据文件并绘制各种图表的脚本。
partID = "part012"; // specifies part ID
DataTable = getDataTable4WfrID2(partID,partID); // loads test data table corresponding to the partID and names it the same as partID
include ("allGraphPlotter.jsl"); //plots all necessary charts上面的脚本按预期工作。
然后(在上面的第四行),我尝试包括您的脚本如下(请注意注释行),用于将图表发送到日志,但不起作用。
我哪里出错了(也许是我的 include 语句或函数调用,例如输出 =打开 Windows 的名称() )?
NamesDefaultToHere(1);
// Returns a list containing the names of all the currently open windows in a session
namesOfOpenWindows =
Function({}, {DefaultLocal},
openWindows = Window();
openWindowNames = {};
For(w=1, w<=NItems(openWindows), w++, InsertInto(OpenWindowNames, OpenWindows[w] << GetWindowTitle));
openWindowNames;
);
// Which windows are open now?
preWindowList = namesOfOpenWindows();
// Open a table
//dt = Open("$SAMPLE_DATA/Big Class.jmp");
// Find out what scripts are in the table
//dts = dt << GetTableScriptNames;
// Run every script
//for (s=1, s<=NItems(dts), s++, dt << runScript(dts[s]));
// Which windows are open now?
postWindowList = namesOfOpenWindows();
// Journal the contents of each 'new' window
for(w=1, w<=NItems(postWindowList), w++,
thisWindow = postWindowList[w];
if (!Contains(preWindowList, thisWindow), Window(thisWindow) << Journal);
);
回复:如何编写脚本将图表和分析数据发送到期刊,而无需手动运行现有的图表/分析脚本?从输出中选择特定报告相当简单,但又非常具体。我建议您花时间阅读脚本指南来开始。然后,您关于如何获取精确报告的具体问题将通过文档得到解答,或者您将能够提供更详细的问题供社区回答。
回复:如何编写脚本将图表和分析数据发送到期刊,而无需手动运行现有的图表/分析脚本?谢谢@ian_jmp 。
你的脚本看起来非常有用,特别是因为我对 JMP 相对较新(来自 MATLAB)。
但是,我不明白你对“我”的评论f 脚本未保存在表中”。
我的脚本已保存,并且不会更改以分析新的测试数据(如我的操作中所述)。
此外,我只需要每个脚本中的特定图表和一些计算的分析数据(例如中位数和标准差,而不是 JMP 也计算的其他参数)即可发送到日志。 在JSL中如何实现这一点?
回复:如何编写脚本将图表和分析数据发送到期刊,而无需手动运行现有的图表/分析脚本?如果你不想修改现有的脚本,你可以尝试这种方法。 如果脚本未保存在表中,请查看 JSL 'Include()' 函数:
NamesDefaultToHere(1);
// Returns a list containing the names of all the currently open windows in a session
namesOfOpenWindows =
Function({}, {DefaultLocal},
openWindows = Window();
openWindowNames = {};
For(w=1, w<=NItems(openWindows), w++, InsertInto(OpenWindowNames, OpenWindows[w] << GetWindowTitle));
openWindowNames;
);
// Which windows are open now?
preWindowList = namesOfOpenWindows();
// Open a table
dt = Open("$SAMPLE_DATA/Big Class.jmp");
// Find out what scripts are in the table
dts = dt << GetTableScriptNames;
// Run every script
for (s=1, s<=NItems(dts), s++, dt << runScript(dts[s]));
// Which windows are open now?
postWindowList = namesOfOpenWindows();
// Journal the contents of each 'new' window
for(w=1, w<=NItems(postWindowList), w++,
thisWindow = postWindowList[w];
if (!Contains(preWindowList, thisWindow), Window(thisWindow) << Journal);
);
回复:如何编写脚本将图表和分析数据发送到期刊,而无需手动运行现有的图表/分析脚本?谢谢。 是的,这确实为我指明了一种可以遵循的方法。
但是,我注意到数据文件加载脚本和图形绘制/分析脚本等需要写入生成日志的脚本中。
就我而言,我已经有单独的脚本来加载数据、绘制必要的图表并生成必要的分析。
我有办法参考现有脚本从日记脚本中提取而不在日记脚本中再次写入它们?
回复:如何编写脚本将图表和分析数据发送到期刊,而无需手动运行现有的图表/分析脚本?在网络上搜索“编写 JMP 日志脚本”将为您提供更多示例,但这可能会为您指明正确的方向:
Names default to here(1);
dt = Open("$SAMPLE_DATA\Big Class.jmp");
// New Journal with a couple headings
nw = New Window("My Journal", <<JOURNAL></JOURNAL>