Highlighted
mksaad
Level I

Transforming tidy DataTable to pair-wise Data Table

Hi, I have an example data table where each row is a specific observation at a given time point. I want to transform this table such that each sample (and associated metadata) gets its own column and the time point values are now distinct columns. I have a short script could read the different values in the Time of Measurement (hr) column from the original data table and then make different columns from those values. But I am having trouble thinking of the best way to fill the new table based on the time and the metadata (sample name included). Anyone have any advice? I have attached the original data table (tidy) and the result I want (paired).

 

Here is the script that I have:

 

 

dt1 = open("JMP_discussion tidy table.jmp");
dt1 << clear row states;
dt2 = New Table ("Paired DT");
summarize(unique_values=by(dt1:Name("Time of Measurement (hr)")));

for (i = 1, i <= N Items(unique_values),i++,
dt2 << New Column(unique_values[i], Numeric)
);

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: Transforming tidy DataTable to pair-wise Data Table

If I am interpreting what you want, you can easily do this with

     Tables==>Split

Open the Split Dialog window and set it up like

spliteasy.PNG

Click on OK and it will give you

spliteasy2.PNG

Jim

View solution in original post

1 REPLY 1
Highlighted
txnelson
Super User

Re: Transforming tidy DataTable to pair-wise Data Table

If I am interpreting what you want, you can easily do this with

     Tables==>Split

Open the Split Dialog window and set it up like

spliteasy.PNG

Click on OK and it will give you

spliteasy2.PNG

Jim

View solution in original post

Article Labels

    There are no labels assigned to this post.