我们正在生成一个脚本,用于根据用户选择的3D图形方向自动生成2D XY坐标列。该脚本将调用R代码来执行计算,但需要向R提供XYZ列数据和旋转设置。
从保存的散点图3D脚本中,我们可以看到XYZ列名称(zue1 ...)和旋转设置(-8 ....)。我们需要jsl代码来选择这些列并导出一个csv文件。并选择和导出旋转设置值的代码。
任何意见,将不胜感激。
散点图3D (
Y(:zue1,:zue2,:zue3),
框架3D (
设置抓握手柄( 0 ),
设定旋转度(- 8.15592033195416 , 47.3040538060599 , 75.4291344975828 )
)
);
您可能不希望将CSV文件用作中介,而是要研究JMP和R集成。
@ian_jmp建议从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");