こんにちは、
私はまだ初心者です、私がこの問題で進歩することを願っています!
"median_range_mm"、"median_range_mm 2"、"median_range_mm 3 ..."という名前の繰り返し列があります。
そして、"target_status"そして "target_status_2"という関連する列.....
1、2、3のすべての中央値範囲で連続分布をプロットしたいです。 同じウィンドウで しかし、私はそれが5とは異なるターゲットステータスを持っている中央値の範囲からすべてのセルをフィルタリングしたいです。
私がはっきりしていることを願っています。これはコード、 "for"というループの中で、ターゲットステータスに対するfilterの条件を書く方法がわかりません。
dt = Current Data Table();
/renaming columns<BR />For( i = 1, i <= 716, i++,<BR /> For( j = 0, j <= 65, j++,<BR /> If(<BR /> i == 1, Column( i ) << set name( "EVENT_BEGIN_OF_CAPTURE" ),<BR /> i == 10, Column( i ) << set name( "Temperature" ),<BR /> i == 16 + 11 * j, Column( i ) << set name( "target_status" ),<BR /> i == 17 + 11 * j, Column( i ) << set name( "median_range_mm" ),<BR /> )<BR /> )<BR />)<BR /><BR />
// for the first ranging column
valMax = Max( :Temperature[dt << get rows where( :target_status == 5 )] ); //max selection
For( d = 3, d <= N Rows( dt ), d++,
val1 = Column( "Temperature" )[d];
val2 = Column( "Temperature" )[d + 1];
dt << select where( val2 - val1 <= 0.1 * valMax ); //stability
);
// plot of the first ranging
New Window( "Only plot median range with a stable temperature",
H List Box(
Distribution(
Uniform Scaling( 1 ),
Continuous Distribution(
Column( :median_range_mm ),
Show Percents( 1 ),
Show Counts( 1 ),
Customize Summary Statistics( Minimum( 1 ), Maximum( 1 ), Median( 1 ), Set Alpha Level( 0.05 ) ),
/* it is the first column so I can write : "target_status" to call the column */ <BR /><FONT face="arial black,avant garde" color="#FF9900"><STRONG> Local Data Filter( Add Filter( columns( :target_status ), Where( :target_status == 5 ) ) );</STRONG></FONT>
)
);
<BR />// looking for the first max value of the ranging
maxValue = Max( :median_range_mm[dt << get rows where( :target_status == 5 )] );
minValue = Min( :median_range_mm[dt << get rows where( :target_status == 5 )] );
// Then look on the others columns
For( p = 2, p <= 64, p++,
nom = "median_range_mm " || Char( p ); // look at ranging median_range_mm 1, 2, 3 ...
col = Column( nom );
name = "target_status " || Char( p ); // look at target status associated
tgt = Column( name );
//dt << get rows where( Column( name ) == 5); // doesn't work
<STRONG> maxValueVar = Max( Column( nom )[dt << get rows where( Column( name ) == 5 )] );
minValueVar = Min( Column( nom )[dt << get rows where( Column( name ) == 5 )] );</STRONG>
If(
maxValueVar > maxValue, maxValue = maxValueVar,
minValueVar < minValue, minValue = minValueVar
);
);
For( g = 2, g <= 64, g++,
nom = "median_range_mm " || Char( g );
col = Column( nom );<BR /> /* there is difficutie*/<BR /><FONT face="arial black,avant garde" color="#FF9900"><STRONG> name = "target_status " || Char( g );
tgt = Column( name );</STRONG></FONT>
valueMax = Max( :Temperature );
For( h = 3, h <= N Rows( dt ), h++,
value1 = Column( "Temperature" )[h];
value2 = Column( "Temperature" )[h + 1];
dt << select where( value2 - value1 <= 0.1 * valueMax ); // this is for a plot with a stable temperature
);
Distribution(
Uniform Scaling( 1 ),
Continuous Distribution(
Column( col ),
Show Percents( 1 ),
Show Counts( 1 ),
Customize Summary Statistics( Minimum( 1 ), Maximum( 1 ), Median( 1 ), Set Alpha Level( 0.05 ) ),<BR /> /* there is the difficultie*/<BR /> /* I don't want to call all the columns " target_status 2 , 3 , 4 .... */ <BR /><FONT face="arial black,avant garde" color="#FF9900"><STRONG> Local Data Filter(
Add Filter( columns( Column( tgt ), Where( Column( tgt ) == 5 ) ) );</STRONG></FONT>
)
)
);
);
)
);
乾杯
いくつかの一般的なアイデア...
まず、行の状態を対話的に操作することが求められる場合、データフィルタは素晴らしいデバイスだと思います。ただし、あなたの場合、行の状態は明示的なループによって制御されるので、フィルタではなくスクリプトを使用して行の状態を直接操作します。
次に、データテーブルメッセージの引数として任意のブール式を使用できます。<< Where(Boolean)を選択します。このメッセージの後に<< Excludeメッセージを続けます。行の状態によって、プラットフォーム(たとえばDistribution)にこれらの観測値が含まれないことがわかります。
第3に、プラットフォーム起動メッセージに、この問題で役立つ可能性があるWhere(Boolean)引数を含めることができます。
最後に、New Window()関数内の2つのループの目的についてはよくわかりません。おそらく、それらを機能の外側に移動し、Append()メッセージを使用してウィンドウにプラットフォームを追加するのが最善です。