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
Created:
Apr 15, 2022 05:07 AM
| Last Modified: Jun 10, 2023 4:47 PM(1025 views)
Hello,
I have a project and my purpose is to extract from my data table (1) the average, maximum and minimum value for each column, and write the results into a new table (2).
I found this part of the code and it seems to work for few columns, but not for all. I have like 300 columns and I have the results for only twenty of them.
For( i = 1, i <= N Col( dt ), i++,
If (:Trial[i] =="TrialName",
If( Column( dt, i ) << get data type == "Numeric",
Write( "\!n", Column( dt, i ) << get name );
Write( Column( dt, i ), "\!nMin: ", Col Min( Column( dt, i ) ) );
Write( "\!nMax: ", Col Max( Column( dt, i ) ) );
Write( "\!nAverage: ", Col Moving Average( Column( dt, i) ) );
Write ("\!n");
)
)
);
I can see the results in the logs but I don't manage to write the results in the right column of my new table (2).
1. I think all my data are not considered as numbers so JMP doesn't want to calculate min, max and average, but I didn't find a way to "force" the type of the data.
2. I don't manage to write my results in the columns of the final table (2).
I don't ask for the full answer but only for tips because I'm really stuck.
To write to other table you could use some of these Add Rows() or New Column(). Write() will just print the values into the JMP Log. Then there is also Data table subscripting , you could possibly use Tabulate() or Summary() to calculate the statistics (maybe even Distribution in combination with make into datatable).
For "forcing" values to be numeric (be careful with this, as this can and will result in a data loss) you could try using << Set Data Type("Numeric")
For more info on functions see Scripting Index in JMP's Help menu
The project that you described can be generated in JMP by using one of the built-in JMP Platforms. And once the platform is run interactively, the JSL to run it can be obtained directly from JMP. I suggest you take a different route to your solution.
Below are he beginning data table and resulting data table after running the platform.
Created:
Apr 15, 2022 08:22 AM
| Last Modified: Apr 15, 2022 5:23 AM(998 views)
| Posted in reply to message from Nuroffen 04-15-2022
You can get what you want using JMP interactively. I will illustrate with Fitness from the Sample Data folder. Assume that the data table is open.
Step 1: Compute statistics
Launch the Distribution platform with all the data columns of interest (Age through MaxPulse).
Right-click on the Summary Statistics table and select Make Combined Data Table.
Step 2: Re-arrange results the way you want.
Select Tables > Split. Select Y column and click Split By. Select Column 2 and select Split Column. Select Keep All. Click OK.
I mean only to illustrate a quick, interactive process. It can be captured in a script as @txnelson suggested. It can be customized at each step as necessary.