當您執行雙變量之類的操作並使用Where()命令時,JMP輸出通常會有一些文字「where(:column 1 == 'F')或其他內容
我正在編寫一些腳本,但我不希望該文字出現。 有沒有辦法防止這種情況發生或事後刪除。 通常我只使用 BY() 命令,但在這種情況下,我想基本上迭代 BY() 級別,以便我可以控制即時報告最終出現在哪些視窗中。 我的腳本運行得很好,但是那些討厭的文字確實讓它看起來很糟糕。
謝謝!
是的,XPath 可以用於此目的。
Names Default To Here( 1 );
// open example
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// open platform with By role
biv = dt << Bivariate(
Y( :weight ),
X( :height ),
Where( :age == 14 | :age == 16 ),
Fit Line
);
Wait( 2 );
// hide text box
biv rep = biv << Report;
((biv rep << Top Parent) << XPath( "//TextBox" ) ) << Delete;
謝謝! 我實際上想知道是否可以使用 XPath 來修復它,但我根本沒有太多使用 XPath,所以這實際上在幾個方面有所幫助!
感謝您提供其他討論的鏈接,我發現了這一點,但完全錯過了解決我的問題的方法。
下面是一個包含 where 子句和刪除該子句的程式碼的報表範例。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Gender_List = {"M", "F"};
age_list = {12, 13, 14, 15};
Property_List = {"Age", "Height", "Weight"};
w = New Window( "test", VLB = V List Box( Text Box( "A" ), dt << Distribution( Nominal Distribution( Column( :age ) ) ) ) );
For( j = 1, j <= N Items( Gender_List ), j++,
VLB << Append( Text Box( Gender_List[j] ) );
VLB << Append(
LB = LB = Lineup Box( N Col( 2 ), spacing( 10 ),
For( i = 1, i <= N Items( Property_List ), i++,
gb = dt << Distribution( Continuous Distribution( Column( Property_List[i] ) ), where( :Sex == Gender_List[j] ) )
)
)
);
);
whereTb = w << XPath("//TextBox[contains(text(), 'Where(:sex == Gender_List[j])')]");
whereTb << Delete;
請參閱先前的社區討論這裡