回复:将数据表存储为元数据(表变量)JSLhttps://community.jmp.com/t5/Discussions/difference-between-set-and-new-table-variable-strange-results-in/mp/429212/highlight/true#M67868从set 和 new table 变量之间的区别 - 写入字符串时出现奇怪的结果?描述了四种不同的函数,set/get/new table variable 和 dt:tablevar,并推荐使用 set table variable 和 dt:tablevar。
回复:将数据表存储为元数据(表变量)JSL要存储的变量是数据表。 dt:tablevar 在这种情况下似乎不起作用。
回复:将数据表存储为元数据(表变量)JSL表变量是字符串。
如果您希望 dt_recovered 在将 dt_metadata 存储在表变量中时相同,则需要将 dt_metadata 转换为表达式的字符串表示形式。 当你从变量中取回它时,你需要解析它。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt_metadata = Open( "$SAMPLE_DATA/Solubility.jmp" );
dt << Set Table Variable( "dt_user", char(dt_metadata));
close(dt_metadata);
dt_recovered = parse(dt << Get Table Variable("dt_user"));
show(dt_recovered);
show(Is String(dt_recovered));
//dt_recovered = Data Table("Solubility.jmp");
//Is String(dt_recovered) = 0;
回复:将数据表存储为元数据(表变量)JSL以下是将表 B 的数据嵌入表 A 的三个示例。 对于合理大小的表,我更喜欢 dtb3 示例。 dtb4 示例就是我认为您所描述的;对于一个巨大的 B 表来说它可能更好,但它对其他人来说是非常不透明的。 dtb5 结合了这两种思想。
// Make sample tables. When done, aa will have two table scripts and a table variable.
// the scripts and variables show three ways to embed bb in aa.
dta = New Table( "aa", New Column( "a", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [1] ) ) );
dtb = New Table( "bb", New Column( "b", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [2] ) ) );
// dtb3: I think you should do this with a table script because it can be
// opened from the GUI or from JSL. The downside is if the table is
// very large it will be slow to save and slow to open because it is
// making a script to recreate the table.
Eval( Eval Expr( dta << NewScript( "bbb", Expr( dtb << getScript ) ) ) );
// jsl to open:
dtb3 = Eval( dta << getScript( "bbb" ) );
dtb3 << SetName( "dtb3" ); // optional, was "bb 2"
// dtb4: it gets ugly with a table variable, there are several possibilities. This
// will save the table and grab the binary from the disk file and make a character
// string from that. You might choose to do this for a really large file, but I'm
// not sure what issues you'll run into.
dtb << Save( "$temp/bb.jmp" );
blob = Load Text File( "$temp/bb.jmp", blob );
blob = Gzip Compress( blob );// optional
text = Char( blob );
dta << SetTableVariable( "bbbb", text );
// reopen
text = dta:bbbb;
blob = Parse( text );
blob = Gzip Uncompress( blob );//optional
dtb4 = Open( blob, "jmp" );
dtb4 << SetName( "dtb4" ); // optional, was "untitled"
// dtb5: you could combine the two ideas, saving the binary data as a table script so
// it can be used from the GUI
dtb << Save( "$temp/bb.jmp" );
blob = Load Text File( "$temp/bb.jmp", blob );
blob = Gzip Compress( blob );// optional
text = Char( blob );
Eval(
Eval Expr(
dta << NewScript(
"bbbbb",
Local( {text, blob, dt},
text = Expr( text );
blob = Parse( text );
blob = Gzip Uncompress( blob );//optional
dt = Open( blob, "jmp" );
dt;
)
)
)
);
// reopen
dtb5 = Eval( dta << getScript( "bbbbb" ) );
dtb5 << SetName( "dtb5" ); // optional, was "untitled"
回复:将数据表存储为元数据(表变量)JSL或者,如果您打算留下链接而不是嵌入数据,则可以使用链接表的文件名:
dta = New Table( "aa", New Column( "a", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [1] ) ) );
dtb = New Table( "bb", New Column( "b", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [2] ) ) );
dta << Save( "$temp/aa.jmp" );
dtb << Save( "$temp/bb.jmp" );
// leave table B's filepath in table A
dta << SetTableVariable("path to B", dtb<<GETPATH></GETPATH>将数据表存储为元数据(表变量)JSL表变量用于存储数据表中的元数据( JSL文档,一般文件)
然而,它们似乎仅限于字符串变量(参见下面的代码)。
将数据表存储为表变量的最佳选择是什么?
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt_metadata = Open( "$SAMPLE_DATA/Solubility.jmp" );
dt << Set Table Variable( "dt_user", dt_metadata );
close(dt_metadata);
dt_recovered = dt << Get Table Variable("dt_user");
show(dt_recovered);
show(Is String(dt_recovered));
//dt_recovered = "Solubility";
//Is String(dt_recovered) = 1;高级统计建模自动化和脚本编写数据混合和清理大规模定制回复:将数据表存储为元数据(表变量)JSL对于列,用户可以指定列属性 - 甚至可以定义用户定义的属性。
那么表格的类似框架怎么样?
这是一个愿望:
有关表的一般信息