Actualizar el nombre de la columna desde el archivo de configuración usando JSL para el tipo de datos de caracteresHola a todos,
Este es un seguimiento de una pregunta anterior relacionada que publiqué ayer. Me gustaría preguntar cómo se actualiza el nombre de una columna para tener unidades de otro archivo de configuración. A continuación se muestra el código de solución que adopté de la publicación de ayer, excepto que hice una modificación para trazar un gráfico logístico en lugar de bivariado. Descubrí que esto funciona bien para gráficos bivariados, pero cuando trato de trazar un gráfico logístico, no puedo ver las unidades como parte de la etiqueta del eje y. Incluso si las unidades son parte del título, estaría bien.
// 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 = open( "table_1.jmp" );
dt1 = open( "config_table.jmp" );
// 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 logistic
For( i = 2, i <= N Cols( dt ), i++,
dt << Logistic( Y( Column( i ) ), X( :id ) )
);Se adjuntan las tablas de datos.
Gracias,
Simón
ScriptingRe: Actualizar el nombre de la columna del archivo de configuración usando JSL para el tipo de datos de caracteresAl parecer, la Plataforma Logística no admite el manejo automático de las (Unidades).Sin embargo, el siguiente script se encarga de eso.

Names Default To Here( 1 );
dt = Data Table( "table_1.jmp" );
dt1 = Data Table( "config_table.jmp" );
// 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 logistic
For( i = 2, i <= N Cols( dt ), i++,
log = dt << Logistic( Y( Column( i ) ), X( :id ) );
Report( log )[AxisBox( 1 )][Text Box( 1 )] <<
set text(
Char( Report( log )[AxisBox( 1 )][Text Box( 1 )] << get text ) || "("
|| Char( Column( i ) << get property( "units" ) ) || ")"
)
;
);Re: Actualizar el nombre de la columna del archivo de configuración usando JSL para el tipo de datos de caracteresHola Jim,
Ejecuté su script y obtuve el siguiente error:
Names Default To Here( 1 );
dt = Open( "table_1.jmp" );
dt1 = Open( "config_table.jmp" );
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]] )
)
);
);
For( i = 2, i <= N Cols( dt ), i++,
log = dt << Logistic( Y( Column( i ) ), X( :id ) );
Report( log )[AxisBox( 1 )][Text Box( 1 )] <<
set text(
Char( Report( log )[AxisBox( 1 )][Text Box( 1 )] << get text ) || "(" ||
Char( Column/*###*/(i) << get property( "units" ) ) || ")"
);
);
invalid argument in access or evaluation of 'Column' , Column/*###*/(i)
/*:
Names Default To Here( 1 );
dt = Open( "table_1.jmp" );
dt1 = Open( "config_table.jmp" );
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]] )
)
);
);
For( i = 2, i <= N Cols( dt ), i++,
log = dt << Logistic( Y( Column( i ) ), X( :id ) );
Report( log )[AxisBox( 1 )][Text Box( 1 )] <<
set text(
Char( Report( log )[AxisBox( 1 )][Text Box( 1 )] << get text ) || "(" ||
Char( Column/*###*/(i) << get property( "units" ) ) || ")"
);
);
invalid argument in access or evaluation of 'Column' , Column/*###*/(i)
Gracias,
Simón