사용자가 선택한 3D 그래프 방향에서 2D XY 좌표 열 생성을 자동화하는 스크립트를 생성하고 있습니다.스크립트는 계산을 수행하기 위해 R 코드를 호출하지만 XYZ 열 데이터와 회전 설정을 R에 제공해야합니다.
저장된 산점도 3D 스크립트에서 XYZ 열 이름 (zue1 ...)과 회전 설정 (-8 ....)을 볼 수 있습니다.해당 열을 선택하고 csv 파일을 내보내려면 jsl 코드가 필요합니다.그리고 회전 설정 값을 선택하고 내보내는 코드입니다.
조언을 주시면 감사하겠습니다.
산점도 3D (
Y (: zue1, : zue2, : zue3),
Frame3D (
손잡이 설정 ( 0 ),
회전 설정 (- 8.15592033195416 , 47.3040538060599 , 75.4291344975828 )
)
);
CSV 파일을 중개자로 사용하는 대신 JMP 및 R 통합 .
헉 JMP에서 R 루틴을 호출하는 것이 문제를 해결하는 좋은 방법이 될 수 있습니다.
데이터 테이블을 통해 csv 패스를 사용해야하는 경우 다음은 csv 파일 생성을 수행하는 한 가지 방법의 간단한 예입니다.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
sp = Scatterplot 3D(
Y( :age, :height, :weight ),
Frame3D( Set Grab Handles( 0 ), Set Rotation( -54, 0, 38 ) )
);
sp << on close(
theScript = Char( (Report( sp ) << get scriptable object) << get script );
varsList = {};
Insert Into( varsList, Word( 2, Substr( theScript, Contains( theScript, "Y(" ) ), ":," ) );
Insert Into( varsList, Word( 4, Substr( theScript, Contains( theScript, "Y(" ) ), ":," ) );
Insert Into( varsList, Word( 6, Substr( theScript, Contains( theScript, "Y(" ) ), ":,)" ) );
rotationList = {};
Insert Into( rotationList, Word( 2, Substr( theScript, Contains( theScript, "Rotation(" ) ), "()," ) );
Insert Into( rotationList, Word( 3, Substr( theScript, Contains( theScript, "Rotation(" ) ), "()," ) );
Insert Into( rotationList, Word( 4, Substr( theScript, Contains( theScript, "Rotation(" ) ), "()," ) );
dtSub = dt << subset( columns( Eval( varsList ) ), selected rows( 0 ) );
dtSub << New Column( "_Vars_", character, set values( varsList ) );
dtSub << New Column( "_Rotation_", character, set values( rotationList ) );
dtSub << Save( "$TEMP/passvalues.csv" );
close( dtSub, nosave );
);
// This line opens the csv back into JMP
//open("$TEMP/passvalues.csv");