回复:將數據表存儲為元數據(表變量)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對於列,使用者可以指定列屬性 - 甚至可以定義使用者定義的屬性。
類似的表格框架怎麼樣?
這裡有一個願望:
有關表的一般信息