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
Re: Actualizar el nombre de la columna del archivo de configuración usando JSL para el tipo de datos de caracteresHe ejecutado el código hasta JMP 11, sin error.Si se da cuenta, hay un / * ### * / en una de las líneas de código que publicó.Elimínelo e intente volver a ejecutar su código.Aquí está el código que utilicé.Tenga en cuenta que cambié su código para hacer referencia a las tablas de datos con el supuesto de que las tablas de datos están abiertas.¿Qué versión de JMP estás usando?
Nombres predeterminados aquí (1); dt = tabla de datos ("table_1.jmp"); dt1 = tabla de datos ("config_table.jmp"); Para (i = 1, i <= N Cols (dt), i ++, foundRow = dt1 << obtener filas donde (: Column_name == Column (dt, i) << obtener nombre & dt1: additional_name! = ""); If (N Rows (foundRow)> 0, Column (dt, i) << establecer propiedad ("unidades", Eval (dt1: additional_name [foundRow [1]])));); Para (i = 2, i <= N Cols (dt), i ++, log = dt << Logistic (Y (Column (i)), X (: id)); Informe (log) [AxisBox (1)] [ Cuadro de texto (1)] << establecer texto (Char (Informe (registro) [AxisBox (1)] [Cuadro de texto (1)] << obtener texto) || "(" || Char (Columna / * ### * / (i) << obtener propiedad ("unidades")) || ")"););Re: Actualizar el nombre de la columna del archivo de configuración usando JSL para el tipo de datos de caracteresEstoy usando JMP12. Vuelvo a recibir el mismo error si ejecuto el código tal como está.
Cuando elimino la línea de abajo, obtengo el gráfico adjunto sin unidades en las etiquetas.
// Char (Columna / * ### * / (i) << obtener propiedad ("unidades")) || ")"
¿Algunas ideas?
Names Default To Here( 1 );
dt = data table( "table_1.jmp" );
dt1 = data table( "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" ) ) || ")"
);
);