3175_zh-TW
將列作為變量傳遞給函數以便在分發中使用嗨,
我正在嘗試將列名稱傳遞給函數,然後在分發中使用它,但它返回:
分發腳本中的命令無法識別。
無需分析數據。
它是分佈中的列(varB)行。
謝謝,
亞歷克斯(Jmp 8)
RuntheGraphs = function({varB},
show(varB);
分配(
統一縮放(0),
連續分配(
列(varB),
水平佈局(1),
垂直(0),
算軸(1),
顯示計數(1),
離群箱圖(0)
)
where(:IPRO_TPT_Completed == 1)
)/*分配*/
);
c =“切片”;
RuntheGraphs(EVAL(C));
消息由以下人員編輯:alexRe:將列作為變量傳遞給函數以供分發使用感謝你們倆。這很棒(如果不是有點黑客)。Re:將列作為變量傳遞給函數以供分發使用第二次嘗試:
Re:將列作為變量傳遞給函數以供分發使用這是我在JSL中遇到的常見問題。當所有其他方法都失敗時,我構建一個表達式,然後對它使用eval(parse())。這是一些有效的代碼:
style =“font-size:10pt; font-family:”Courier New“; color:black;”> RuntheGraphs
style =“font-size:10pt; font-family:”Courier New“; color:navy;”> =
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
style =“font-size:10pt; font-family:”Courier New“;顏色:rgb(0,0,221);”>功能
style =“font-size:10pt; font-family:”Courier New“; color:black;”>(
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
{ varB }
style =“font-size:10pt; font-family:”Courier New“; color:navy;”>,
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
風格=“”>
style =“font-size:10pt; font-family:”Courier New“;顏色:rgb(0,0,221);”>顯示
style =“font-size:10pt; font-family:”Courier New“; color:black;”>(
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
varB )
style =“font-size:10pt; font-family:”Courier New“; color:navy;”>;
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
風格=“”>
dist_expr
style =“font-size:10pt; font-family:”Courier New“; color:navy;”> =
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
style =“font-size:10pt; font-family:”Courier New“; color:purple;”>“
風格=“”> 分配(
style =“font-size:10pt; font-family:”Courier New“; color:purple;”>
風格=“”>
制服
縮放(0),
style =“font-size:10pt; font-family:”Courier New“; color:purple;”>
風格=“”>
連續
分配(
style =“font-size:10pt; font-family:”Courier New“; color:purple;”>
風格=“”>
柱(”
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
style =“font-size:10pt; font-family:”Courier New“; color:navy;”> ||
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
風格=“”> varB
風格=“”>
style =“font-size:10pt; font-family:”Courier New“; color:navy;”> ||
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
style =“font-size:10pt; font-family:”Courier New“; color:purple;”>“),
style =“font-size:10pt; font-family:”Courier New“; color:purple;”>
風格=“”>
橫
佈局(1),
style =“font-size:10pt; font-family:”Courier New“; color:purple;”>
風格=“”>
垂直(
0),
style =“font-size:10pt; font-family:”Courier New“; color:purple;”>
風格=“”>
計數
軸(1),
style =“font-size:10pt; font-family:”Courier New“; color:purple;”>
風格=“”>
節目
計數(1),
style =“font-size:10pt; font-family:”Courier New“; color:purple;”>
風格=“”>
局外人
方塊圖(0)
style =“font-size:10pt; font-family:”Courier New“; color:purple;”>
風格=“”>
)
style =“font-size:10pt; font-family:”Courier New“; color:purple;”>
風格=“”>
哪裡(
:性別== \!“F \!” )
style =“font-size:10pt; font-family:”Courier New“; color:purple;”>
風格=“”>
)“
style =“font-size:10pt; font-family:”Courier New“; color:navy;”>;
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
風格=“”>
style =“font-size:10pt; font-family:”Courier New“;顏色:rgb(0,0,221);”> eval
style =“font-size:10pt; font-family:”Courier New“; color:black;”>(
style =“font-size:10pt; font-family:”Courier New“; color:rgb(0,0,221);”>解析
style =“font-size:10pt; font-family:”Courier New“; color:black;”>(
style =“font-size:10pt; font-family:”Courier New“; color:black;”> dist_expr ))
style =“font-size:10pt; font-family:”Courier New“; color:navy;”>;
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
風格=“”>
style =“font-size:10pt; font-family:”Courier New“; color:black;”>)
style =“font-size:10pt; font-family:”Courier New“; color:navy;”>;
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
style =“font-size:10pt; font-family:”Courier New“; color:black;”> dt
style =“font-size:10pt; font-family:”Courier New“; color:navy;”> =
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
style =“font-size:10pt; font-family:”Courier New“;顏色:rgb(0,0,221);”>打開
style =“font-size:10pt; font-family:”Courier New“; color:black;”>(
style =“font-size:10pt; font-family:”Courier New“; color:purple;”>“$ sample_data \ big
class.jmp“
style =“font-size:10pt; font-family:”Courier New“; color:black;”>)
style =“font-size:10pt; font-family:”Courier New“; color:navy;”>;
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
style =“font-size:10pt; font-family:”Courier New“; color:black;”> c
style =“font-size:10pt; font-family:”Courier New“; color:navy;”> =
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
style =“font-size:10pt; font-family:”Courier New“; color:purple;”>“height”
style =“font-size:10pt; font-family:”Courier New“; color:navy;”>;
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
style =“font-size:10pt; font-family:”Courier New“; color:black;”> RuntheGraphs (
C )
style =“font-size:10pt; font-family:”Courier New“; color:navy;”>;
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
style =“font-size:10pt; font-family:”Courier New“; color:black;”>
Re:將列作為變量傳遞給函數以供分發使用我現在把這本書打開了!
你能給我這個頁面嗎?
(看起來你做了一個put和過去,但它在html中迷失了)Re:將列作為變量傳遞給函數以供分發使用嗨,亞歷克斯:
跳轉到JMP腳本
作者:Wendy Murphrey和Rosemary Lucas
https://support.sas.com/pubscat/bookdetails.jsp?catid=1&pc=61733
舉個例子:
< -
/ *解決方案9.2 * /
/ *打開Fitness樣本數據表Ni。* /
dt =打開(“$ SAMPLE_DATA / Fitness.jmp”);
/ *將條件分配給全局變量。* /
selVar =“M”;
yvar =“MaxPulse”;
xvar =“RstPulse”;
/ *構建主表達式。* /
bivExpr = Expr(
二元(
Y(:Expr(yvar)),
X(:Expr(xvar)),
/ *通過使用Expr函數包裝它來標識全局變量。* /
哪裡(:性別== Expr(selVar))
)
);
/ *首先解析全局變量表達式。然後解析主表達式。* /
Eval(Eval Expr(bivExpr));
適應你的特定例子:
dt = Open(“$ sample_data / Big Class.jmp”);
/ *將條件分配給全局變量。* /
c =“高度”;
/ *構建主表達式。* /
dist = Expr(分佈式(
連續分配(
/ *通過使用Expr函數包裝它來標識全局變量。* /
專欄(:Expr(c)),
水平佈局(1),
垂直(0),
擬合分佈(正常)
)
)
);
/ *首先解析全局變量表達式。然後解析主表達式。* /
Eval(Eval Expr(dist));
- >
最好的祝福,
-Matt
Comments
There are no comments yet