Here are 2 different approaches to the issue that do not change the actual name of the columns, but accomplishes what you are asking for. The first one creates Transform columns that have the new names specified for the run of the bivariate. Those columns only exist for the bivariate execution.
The second example uses the Units Column Property for the different columns in the data table. The platforms in JMP honor the Units column property, and display it as an addition to the actual column name by placing the Units value in () following the column name.....(i.e. Height(feet) )
// This version of the script used Transform variables
// to temporarially change the name of the column just
// for the running of the Bivariate
Names Default To Here( 1 );
dt = Data Table( "table_1" );
dt1 = Data Table( "config_table" );
// Loop across the columns to run the Bivariate
For( i = 2, i <= N Cols( dt ), i++,
// Check to see if a column name change is specified
// in the config table
foundRow = dt1 << get rows where(
:Column_name == Column( dt, i ) << get name & dt1
:additional_name != ""
);
// If a column name change is found make the change
If( N Rows( foundRow ) > 0,
Eval(
Substitute(
Expr(
Bivariate(
Y(
Transform Column(
__trans__,
Formula( __col__ )
)
),
X( :id )
)
),
Expr( __trans__ ),
dt1:Column_name[foundRow[1]] || "_" || dt1
:additional_name[foundRow[1]],
Expr( __col__ ),
Parse( ":" || dt1:Column_name[foundRow[1]] )
)
),
// otherwise just run the bivariate
dt << Bivariate( Y( Column( i ) ), X( :id ) )
);
);
// This version of the script takes advantage of the Units
// column property. It will automatically add (unit value) to
// the display output, without actually changing the columns
// name
Names Default To Here( 1 );
dt = Data Table( "table_1" );
dt1 = Data Table( "config_table" );
// Add the Units Column Property to the columns in the
// original data table
For( i = 1, i <= N Cols( dt ), i++,
foundRow = dt1 << get rows where(
:Column_name == Column( dt, i ) << get name & dt1
:additional_name != ""
);
If( N Rows( foundRow ) > 0,
column( dt, i ) << set property("units", eval(dt1:additional_name[foundRow[1]]));
);
);
// Now run the normal bivariates
For( i = 2, i <= N Cols( dt ), i++,
dt << Bivariate( Y( Column( i ) ), X( :id ) )
);
Jim