使用JSL作為字符數據類型從配置文件更新列名大家好,
這是我昨天發布的一個較早相關問題的跟進。 我想問一下您如何更新列名以具有來自另一個配置文件的單位。 下面是我昨天的帖子採用的解決方案代碼,除了我進行了修改以繪製邏輯圖而不是雙變量。 我發現這對於二元圖來說效果很好,但是當我嘗試繪製對數圖時,我無法將單位視為y軸標籤的一部分。 即使單位是標題的一部分,也可以。
// This version of the script used Transform variables
// to temporarially change the name of the column just
// for the running of the Bivariate
Names Default To Here( 1 );
dt = open( "table_1.jmp" );
dt1 = open( "config_table.jmp" );
// Add the Units Column Property to the columns in the
// original data table
For( i = 1, i <= N Cols( dt ), i++,
foundRow = dt1 << get rows where(
:Column_name == Column( dt, i ) << get name & dt1
:additional_name != ""
);
If( N Rows( foundRow ) > 0,
column( dt, i ) << set property("units", eval(dt1:additional_name[foundRow[1]]));
);
);
// Now run logistic
For( i = 2, i <= N Cols( dt ), i++,
dt << Logistic( Y( Column( i ) ), X( :id ) )
);數據表已隨附。
謝謝,
西蒙
腳本編寫關於使用字符數據類型的JSL從配置文件更新列名稱顯然,Logistic平台不支持對(單位)的自動處理。但是,下面的腳本可以解決這個問題。

Names Default To Here( 1 );
dt = Data Table( "table_1.jmp" );
dt1 = Data Table( "config_table.jmp" );
// Add the Units Column Property to the columns in the
// original data table
For( i = 1, i <= N Cols( dt ), i++,
foundRow = dt1 << get rows where(
:Column_name == Column( dt, i ) << get name & dt1:additional_name !=
""
);
If( N Rows( foundRow ) > 0,
Column( dt, i ) << set property(
"units",
Eval( dt1:additional_name[foundRow[1]] )
)
);
);
// Now run logistic
For( i = 2, i <= N Cols( dt ), i++,
log = dt << Logistic( Y( Column( i ) ), X( :id ) );
Report( log )[AxisBox( 1 )][Text Box( 1 )] <<
set text(
Char( Report( log )[AxisBox( 1 )][Text Box( 1 )] << get text ) || "("
|| Char( Column( i ) << get property( "units" ) ) || ")"
)
;
);關於使用字符數據類型的JSL從配置文件更新列名稱吉姆,你好
我運行了您的腳本,並出現以下錯誤:
Names Default To Here( 1 );
dt = Open( "table_1.jmp" );
dt1 = Open( "config_table.jmp" );
For( i = 1, i <= N Cols( dt ), i++,
foundRow = dt1 << get rows where(
:Column_name == Column( dt, i ) << get name & dt1:additional_name != ""
);
If( N Rows( foundRow ) > 0,
Column( dt, i ) << set property(
"units",
Eval( dt1:additional_name[foundRow[1]] )
)
);
);
For( i = 2, i <= N Cols( dt ), i++,
log = dt << Logistic( Y( Column( i ) ), X( :id ) );
Report( log )[AxisBox( 1 )][Text Box( 1 )] <<
set text(
Char( Report( log )[AxisBox( 1 )][Text Box( 1 )] << get text ) || "(" ||
Char( Column/*###*/(i) << get property( "units" ) ) || ")"
);
);
invalid argument in access or evaluation of 'Column' , Column/*###*/(i)
/*:
Names Default To Here( 1 );
dt = Open( "table_1.jmp" );
dt1 = Open( "config_table.jmp" );
For( i = 1, i <= N Cols( dt ), i++,
foundRow = dt1 << get rows where(
:Column_name == Column( dt, i ) << get name & dt1:additional_name != ""
);
If( N Rows( foundRow ) > 0,
Column( dt, i ) << set property(
"units",
Eval( dt1:additional_name[foundRow[1]] )
)
);
);
For( i = 2, i <= N Cols( dt ), i++,
log = dt << Logistic( Y( Column( i ) ), X( :id ) );
Report( log )[AxisBox( 1 )][Text Box( 1 )] <<
set text(
Char( Report( log )[AxisBox( 1 )][Text Box( 1 )] << get text ) || "(" ||
Char( Column/*###*/(i) << get property( "units" ) ) || ")"
);
);
invalid argument in access or evaluation of 'Column' , Column/*###*/(i)
謝謝,
西蒙
關於使用字符數據類型的JSL從配置文件更新列名稱我已經將代碼一直運行到JMP 11,沒有錯誤。如果您注意到,您發布的代碼行之一中就有一個/ * ### * /。請刪除它,然後嘗試重新運行您的代碼。這是我使用的代碼。請注意,我在假設數據表已打開的情況下更改了代碼以引用數據表。您正在使用什麼版本的JMP。
名稱默認為Here(1); dt =數據表(“ table_1.jmp”); dt1 =數據表(“ config_table.jmp”); For(i = 1,i <= N Cols(dt),i ++,foundRow = dt1 <<獲取行其中(:Column_name == Column(dt,i)<<獲得名稱&dt1:additional_name!=“”); If(N Rows(foundRow)> 0,Column(dt,i)<<設置屬性(“ units”,Eval(dt1:additional_name [foundRow [1]])));); For(i = 2,i <= N Cols(dt),i ++,log = dt << Logistic(Y(Column(i)),X(:id)); Report(log)[AxisBox(1)] [文本框(1)] <<設置文本(Char(Report(log)[AxisBox(1)] [文本框(1)] <<獲取文本)||“(” || Char(Column / * ### * /(i)<< get property(“ units”))||“)”););關於使用字符數據類型的JSL從配置文件更新列名稱我正在使用JMP12。 如果我按原樣運行代碼,則會再次遇到相同的錯誤。
當我刪除下面的行時,我得到的標籤上沒有任何單位的附件圖。
// Char(Column / * ### * /(i)<< get property(“ units”))|| “)”
有任何想法嗎?
Names Default To Here( 1 );
dt = data table( "table_1.jmp" );
dt1 = data table( "config_table.jmp" );
For( i = 1, i <= N Cols( dt ), i++,
foundRow = dt1 << get rows where(
:Column_name == Column( dt, i ) << get name & dt1:additional_name != ""
);
If( N Rows( foundRow ) > 0,
Column( dt, i ) << set property(
"units",
Eval( dt1:additional_name[foundRow[1]] )
)
);
);
For( i = 2, i <= N Cols( dt ), i++,
log = dt << Logistic( Y( Column( i ) ), X( :id ) );
Report( log )[AxisBox( 1 )][Text Box( 1 )] <<
set text(
Char( Report( log )[AxisBox( 1 )][Text Box( 1 )] << get text ) || "("
//Char( Column/*###*/(i) << get property( "units" ) ) || ")"
);
);