cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
njmp
Level I

Adding new columns to a data table

i create a table and try add two aolumns in jsl as follows:

Test = New Table( "Test" );
Test << New Column( "Ident", Character, Continuous, Format( "Best", 8 ), set values( identifiers ) );
Test << New Column( "Value", Numeric, Continuous, Format( "Best", 8 ), set values( values ) );

identifiers - is a list of caharacters

values - a a list of matching numbers.

using the format above, creates only ident column , populates with values and stops before adding the second column. no report of an error.

(if i run the command latter manually it adds also Value column and the values.

 

if i use a slightly different format (below), no issues and both columns are created and populated with the values:

Test=new table("Test");
Test<<new column("Value",Numeric,Continuous,format("Best",8),set values(values));
Test<<new column("Ident",Character,Continuous,format("Best",8),set values(identifiers));

any explanation to this behavior?

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Adding new columns to a data table

A column that has is of Data Type, "Character", can only have a Modeling Type of "Nominal".  Also, a Format definition for a Character column can not be specified.  The script below is a modification of your script that runs without error

Names Default To Here( 1 );

identifiers = {"a", "b", "c"};
values = {1, 2, 3};

Test = New Table( "Test" );
Test <<
New Column( "Ident",
	Character,
	set values( identifiers )
);
Test <<
New Column( "Value",
	Numeric,
	Continuous,
	Format( "Best", 8 ),
	set values( values )
);
Jim

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: Adding new columns to a data table

A column that has is of Data Type, "Character", can only have a Modeling Type of "Nominal".  Also, a Format definition for a Character column can not be specified.  The script below is a modification of your script that runs without error

Names Default To Here( 1 );

identifiers = {"a", "b", "c"};
values = {1, 2, 3};

Test = New Table( "Test" );
Test <<
New Column( "Ident",
	Character,
	set values( identifiers )
);
Test <<
New Column( "Value",
	Numeric,
	Continuous,
	Format( "Best", 8 ),
	set values( values )
);
Jim
njmp
Level I

Re: Adding new columns to a data table

Thanks a lot:)
Jackie_
Level VI

Re: Adding new columns to a data table

Hi @txnelson,

 

Thanks for your help. 

2nd file doesn't have Minimum Age Column. How can I create the 2nd column with name "Minimum Age" and then run the above script?