將列名列表插入公式中嗨,
我正在製作一個創建約14種不同期刊的腳本。 我可能準備10個不同的數據集,每個期刊的每個數據都要更新其他表中的特定數據,然後繪製特定數據的圖表。 我腳本的圖表設置比我提供的示例腳本更複雜。 請幫我弄清楚如何在我的腳本中使用變量作為列名。 我已經嘗試了一堆Parse,eval和expr的組合,但無法使它工作
想做這樣的事情:
table1 = open("$SAMPLE_DATA/students1.jmp");
table2 = open("$SAMPLE_DATA/students2.jmp");
ins = ":height, :weight";
table1 << Update(With( table2 ),
Match Columns( :name = :name ),
Add Columns from Update table( parse(ins) ));
Current Data Table(table1);
Scatterplot Matrix(
Y( parse(ins) ),
X( :sex ),
Matrix Format( "Lower Triangular" ),
Ellipse Color( 3 ),
Fit Line( 0 )
);結果我想這樣:
table1 = open("$SAMPLE_DATA/students1.jmp");
table2 = open("$SAMPLE_DATA/students2.jmp");
table1 << Update(With( table2 ),
Match Columns( :name = :name ),
Add Columns from Update table( :height, :weight ));
Current Data Table(table1);
Scatterplot Matrix(
Y( :height, :weight ),
X( :sex ),
Matrix Format( "Lower Triangular" ),
Ellipse Color( 3 ),
Fit Line( 0 )
);Re:將列名列表插入公式中這是一種老式的處理問題的方式
names default to here(1);
table1 = open("$SAMPLE_DATA/students1.jmp");
table2 = open("$SAMPLE_DATA/students2.jmp");
ins = ":height, :weight;";
eval(parse(
"table1 << Update(With( table2 ),
Match Columns( :name = :name ),
Add Columns from Update table( "||ins||" ));"));
Current Data Table(table1);
Scatterplot Matrix(
Y( parse(ins) ),
X( :sex ),
Matrix Format( "Lower Triangular" ),
Ellipse Color( 3 ),
Fit Line( 0 )
);Re:將列名列表插入公式中吉姆,嗨,
如何使用相同的方法進行散點圖?其中一個散點圖參數有引號。 謝謝!
Re:將列名列表插入公式中\!是JMP中的轉義序列,因此,如下面的腳本所示,\!“用於在帶引號的字符串中嵌入雙引號
theExpr = (
"Bivariate( Y( :height ), X( :weight ),
Where( :sex == \!"F\!" ) );"
);
eval(Parse(theExpr));
“腳本指南”中介紹了所有這些內容。 我強烈建議你花點時間閱讀它。
幫助==>圖書==>腳本指南
Re:將列名列表插入公式中謝謝