안녕하세요 여러분,
나는 일부 계산을 기반으로 JMP 테이블(예: table-1)에 여러 열을 생성할 스크립트를 작성했습니다. 이제 Table-1의 일부 선택된 행과 열을 다른 JMP 테이블(예: table-2)에 채우고 싶습니다. 선택한 행과 열로 두 번째 테이블을 채우는 데 도움이 필요합니다.
친절하게 제안해 보세요.
문안 인사,
딜립
귀하가 요청한 작업을 수행하는 몇 가지 방법은 다음과 같습니다.업데이트 플랫폼을 사용하는 첫 번째 방법은 셀 간 업데이트보다 훨씬 더 효율적이지만 둘 다 잘 작동하고 각 기술을 사용하려는 위치가 있습니다.
Names Default To Here( 1 );
dt1 = Open( "$SAMPLE_DATA/big class.jmp" );
dt2 = Open( "$SAMPLE_DATA/big class families.jmp" );
// Add a new columns
dt1 << New Column( "Height, Weight ratio", formula( :weight / :height ) );
dt1 << New Column( "Age, Height ratio", formula( :height / :Age ) );
// Add the Height, Weight ratio to the dt2 data table, for only the
// females, using a simple subset and a join
dt1 << select where( :sex == "F" );
dtSubset = dt1 << subset(
private,
selected rows( 1 ),
columns( {"name", "Height, Weight ratio"} )
);
dt2 << Update( With( dtSubset ), Match Columns( :name = :name ) );
Close( dtSubset, nosave );
// Add the Age, Height ratio to the dt2 data table for only the
// 13 year olds, using cell by cell processing
dt2 << New Column( "Age, Height ratio" );
For( i = 1, i <= N Rows( dt1 ), i++,
If( dt1:age[i] == 13,
foundRow = dt2 << get rows where( dt1:name[i] == dt2:name & dt2:age == 13 );
If( N Rows( foundRow ) == 1,
theRow = foundRow[1];
dt2:Name( "Age, Height ratio" )[theRow] = dt1:Name( "Age, Height ratio" )[i];
);
)
);
또한 사용할 수 있는 다른 방법도 있습니다.사용 가능한 다양한 옵션에 대한 좋은 느낌을 얻으려면 스크립팅 가이드를 읽어 보시기 바랍니다.
도움말==>도서==>스크립팅 가이드