cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
newbie_alex
Level III

how to convert column names to a list of strings

Hi,

 

I would like to convert column names to strings but I do not know how.

 

dt = Open( "$SAMPLE_DATA/Decathlon.jmp" );

col_names = dt << Get Column Names();

Show(col_names);

this leads to

col_names = {Name, Country, Score, Name("100m"), Long Jump, Shot Put, High Jump, Name("400m"), Name("100m hurdles"), Discus, Pole Vault, Javelin, Name("1500m")};

I would like to have something like this instead:

col_names = {"Name", "Country", "Score", "100m", "Long Jump", "Shot Put", "High Jump", "400m", "100m hurdles", "Discus", "Pole Vault", "Javelin", "1500m"};

Any idea?

 

Thank you for your help!

 

20 REPLIES 20
pcarroll1
Level IV

Re: how to convert column names to a list of strings

This worked but I needed to first make a group name variable.

j=1;

GN = "ColGroup"||j;

dt << Group Columns(GN, col_list);

worked.

But

dt << Group Columns("ColGroup"||j, col_list);

did not. 

It turned out this was the problem all along.

 

The error message made the problem look like it was with the column list.

Recommended Articles