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
%3CLINGO-SUB%20id%3D%22lingo-sub-780140%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%E7%84%A1%E6%B3%95%E8%BE%A8%E8%AD%98%E7%82%BA%E5%AD%98%E5%8F%96%20For%20%E8%BF%B4%E5%9C%88%E4%B8%AD%E7%9A%84%E8%A1%A8%E6%A0%BC%E5%8F%83%E6%95%B8%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-780140%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3E%E6%88%91%E6%AD%A3%E5%9C%A8%E5%98%97%E8%A9%A6%E9%80%A3%E6%8E%A5%E6%88%91%E7%9A%84%E5%AD%90%E9%9B%86%E8%A1%A8%EF%BC%8C%E4%BD%86%E6%88%91%E4%B8%8D%E6%96%B7%E6%94%B6%E5%88%B0%E6%AD%A4%E9%8C%AF%E8%AA%A4%EF%BC%9A%3CBR%20%2F%3E%E7%84%A1%E6%B3%95%E8%BE%A8%E8%AD%98%E7%82%BA%E5%AD%98%E5%8F%96%E6%88%96%E8%A9%95%E4%BC%B0%20'dtSubsetList%20%5B%20%2F*%23%23%23*%2Fi%5D'%20%E3%80%81%20dtSubsetList%20%5B%2F*%23%23%23*%2Fi%5D%20%E6%99%82%E7%9A%84%E8%A1%A8%E6%A0%BC%E5%8F%83%E6%95%B8%3C%2FP%3E%3CP%3EIm%20using%20JMP%2016%3CCODE%20class%3D%22%20language-jsl%22%3E%3C%2FCODE%3E%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Enames%20default%20to%20here(1)%3B%0Adt%20%3D%20Open(%20%22%24SAMPLE_DATA%2FBig%20Class.jmp%22%20)%3B%0A%0AdtSubsetList%20%3D%20dt%20%26lt%3B%26lt%3B%20Subset(%0A%09By(%20%3Asex%20)%2C%0A%09All%20rows%2C%0A%09Selected%20columns%20only(%200%20)%2C%0A%09columns(%20%3Aname%2C%20%3Aage%2C%20%3Aheight%2C%20%3Aweight%20)%0A)%3B%0A%0AdtNew%20%3D%20New%20Table(%20%22New%20Table%22%20)%3B%0A%20%0AFor(i%20%3D%201%2C%20i%20%26lt%3B%3D%20N%20Items(dtSubsetList%20)%2C%20i%2B%2B%2C%20%0AdtNew%20%26lt%3B%26lt%3B%20Concatenate(dtSubsetList%5Bi%5D%2C%20Append%20to%20first%20table(1))%3B%20%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-780140%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CLINGO-LABEL%3E%E8%87%AA%E5%8B%95%E5%8C%96%E5%92%8C%E8%85%B3%E6%9C%AC%E7%B7%A8%E5%AF%AB%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E%E8%A6%96%E7%AA%97%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-780152%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E5%9C%A8%E8%A8%AA%E5%95%8F%20For%20%E5%BE%AA%E7%92%B0%E4%B8%AD%E7%84%A1%E6%B3%95%E8%AD%98%E5%88%A5%E7%82%BA%E8%A1%A8%E6%A0%BC%E5%8F%83%E6%95%B8%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-780152%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E7%84%A1%E6%B3%95%E8%A4%87%E8%A3%BD%E8%A9%B2%E5%95%8F%E9%A1%8C%E3%80%82%E6%82%A8%E7%9A%84%E8%85%B3%E6%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%B2%E8%81%AF%EF%BC%8C%E8%80%8C%E4%B8%8D%E5%BF%85%E5%88%86%E5%88%A5%E5%BE%AA%E7%92%B0%E9%81%8D%E6%AD%B7%E6%AF%8F%E5%80%8B%E8%B3%87%E6%96%99%E8%A1%A8%E3%80%82%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0Adt%20%3D%20Open(%20%22%24SAMPLE_DATA%2FBig%20Class.jmp%22%20)%3B%0A%0AdtSubsetList%20%3D%20dt%20%26lt%3B%26lt%3B%20Subset(%0A%09By(%20%3Asex%20)%2C%0A%09All%20rows%2C%0A%09Selected%20columns%20only(%200%20)%2C%0A%09columns(%20%3Aname%2C%20%3Aage%2C%20%3Aheight%2C%20%3Aweight%20)%0A)%3B%0A%0AdtNew%20%3D%20New%20Table(%20%22New%20Table%22%20)%3B%0A%20%0A%2F*For(%20i%20%3D%201%2C%20i%20%26lt%3B%3D%20N%20Items(%20dtSubsetList%20)%2C%20i%2B%2B%2C%0A%09dtNew%20%26lt%3B%26lt%3B%20Concatenate(%20dtSubsetList%5Bi%5D%2C%20Append%20to%20first%20table(%201%20)%20)%0A)%3B*%2F%0A%0AdtNew%20%26lt%3B%26lt%3B%20Concatenate(%20dtSubsetList%2C%20Append%20to%20first%20table(%201%20)%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
UserID16644
Level V

unrecognized as table argument in access For loop

I am trying to concatenate my subset tables, but I kept getting this error:
unrecognized as table argument in access or evaluation of 'dtSubsetList [ /*###*/i]' , dtSubsetList [/*###*/i]

Im using JMP 16

 

names default to here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dtSubsetList = dt << Subset(
	By( :sex ),
	All rows,
	Selected columns only( 0 ),
	columns( :name, :age, :height, :weight )
);

dtNew = New Table( "New Table" );
 
For(i = 1, i <= N Items(dtSubsetList ), i++, 
dtNew << Concatenate(dtSubsetList[i], Append to first table(1)); 
);

 

 

1 REPLY 1
txnelson
Super User

Re: unrecognized as table argument in access For loop

I am unable to replicate the issue.  Your script runs properly without error.

I suggest that you exit JMP, and then reopen it and then run the script.  Your dt_Test is obviously not in the JSL you provided, and is probably an artifact of all of the trial and errors you have attempted.

I will also suggest a change to your code.  The Concatenate platform has the ability to concatenate more than one table in a single execution.  Therefore you can actually past the complete list of data table to the Concatenation rather than having to loop through each one separatly.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dtSubsetList = dt << Subset(
	By( :sex ),
	All rows,
	Selected columns only( 0 ),
	columns( :name, :age, :height, :weight )
);

dtNew = New Table( "New Table" );
 
/*For( i = 1, i <= N Items( dtSubsetList ), i++,
	dtNew << Concatenate( dtSubsetList[i], Append to first table( 1 ) )
);*/

dtNew << Concatenate( dtSubsetList, Append to first table( 1 ) );
Jim