안녕하세요,
JMP 스크립팅을 경험이없는 사용자는 새 열을 추가하는 방법에 대한 도움이 필요하며 새 열의 데이터는 사용자가 고정 번호로 정의합니다. 즉, 코드를 실행할 때마다 관심있는 수의 새 열을 채워야한다는 것을 의미합니다. 실제로 동일한 데이터 테이블을 채우는 데 필요한 수와 다른 작업 (새 열의 경우)이 다릅니다.
귀하의 요청을 이해하면 값을 사용자로 사용하고 수식에서 해당 값을 사용하려는 것처럼 들립니다. 시작하는 데 도움이 될 수 있습니다.
//Make sure variables names defined here do not interfere with other scripts
Names default to here(1);
//start by opening a data table. Instead of this, you could just use
// dt = current data table();
dt = Open("$Sample_Data/iris.jmp");
dt << New Script(
"New Column",
//Open a new window which...
win = New Window ( "Create a column",
Show Menu( 0 ),
Show Toolbars( 0 ),
v list box(
Text Box( "Add a new column."),
Spacer box( Size( 20,20 ) ),
//asks the user for a column name...
Text Box("Enter a column name"),
tebName = Text Edit Box( "Column 1", Set Width( 200 ) ),
Spacer box( Size( 10,10 ) ),
//and a value...
Text Box("Enter a value in the column"),
nebValue = Number Edit Box( 0 ),
Spacer box( Size( 10,10 ) ),
H list box(
//and includeds a button with a script that creates the column...
Button Box( "Create A Column",
//Use Eval, Eval Expr, and Expr to put the RESULT of the expression "nebValue << Get" into the formula
//instead of the expression itself
Names default to here( 1 );
dt = current data table();
Eval( Eval Expr(
dt << New Column( tebName << Get Text, Numeric, "Continuous", Format("Best", 12), Formula( Expr( nebValue << Get ) ) )
) )
),
//and another button to close the window.
Button Box( "Close",
win << Close Window
)
)
)
);
);안녕하세요,
도와 주셔서 감사합니다. 주로 저의 대본을 완성하는 데 도움이됩니다. 사실, 내 임무와 임무는 완전한 데이터를 포함하지 않은 csv 파일을 꺼내고 가변 데이터로 완성 해야하는 프로젝트에 달려 있습니다. 코드가 더 도움이되는 것처럼 보이므로 이제는 단일 코드 만 사용하여 그래프를 얻을 때까지 초기 단계에서 결합하는 방법에 대해 생각해야합니다. 어쩌면이 커뮤니티 그룹의 전문가가 조언을 구해야 할 수도 있습니다. 대단히 감사합니다.