Scripting Guide > Data Tables > Add Metadata to a Data Table
发布日期: 08/07/2020

Add Metadata to a Data Table

Data tables store observation data, or measurements of various variables on a specific set of subjects. However, JMP data tables can also store metadata, or data about the data.

Table Variables

Table Scripts

Formulas

Delete Metadata

Table Variables

Table variables are for storing a single text string value, such as “Notes”. To understand how variables work, first get its existing value by sending a Get Table Variable message:

dt = Open( "$SAMPLE_DATA/Solubility.jmp" );
dt << Get Table Variable( "Notes" );

"Chemical compounds were measured for solubility in different solvents. This table shows the log of the partition coefficient (logP) of 72 organic solutes in 6 aqueous/nonpolar systems."

Now change the existing value of the string using Set Table Variable and then use Get Table Variable again to check that the string has been updated:

dt << Set Table Variable( "Notes", "Solubility of chemical compounds" );
dt << Get Table Variable( "Notes" );

"Solubility of chemical compounds"

The following example adds two new table variables to a data table:

dt = Open( "$DOCUMENTS/Big Class.jmp" );
myvar = "This is my version of the JMP Big Class sample data.";
dt << Set Table Variable( "key1", myvar );
dt << Set Table Variable( "key2", myvar );

Notice that setting the value creates a new variable only if one by the given name does not already exist. If you add two table variables with the same name, only one variable is created.

需要更多信息?有问题?从 JMP 用户社区得到解答 (community.jmp.com).