JSL - Create new data column by row # specified in lists<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />I'm trying to take some lists I have and create a new data column in which the data from data_list is placed into the rows specified by row_list. How would I best go about doing this using the example information below?
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Column( "X" );
row_list = { 1, 6, 9, 18, 24, 30 };
data_list = { 5, 10, 15, 20, 25, 30 };
Re: JSL - Create new data column by row # specified in listsJust loop over your lists:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Column( "X" );
row_list = { 1, 6, 9, 18, 24, 30 };
data_list = { 5, 10, 15, 20, 25, 30 };
for (i = 1, i <= nitems(row_list), i++,
one_row = row_list[i];
column(dt, "X")[one_row] = data_list[i];
);