3175_es-ES
Pase la columna como variable para funcionar para su uso en la distribución.Hola,
Estoy tratando de pasar el nombre de la columna a una función y luego usarla en la Distribución, pero vuelve con:
No se reconoció un comando dentro del script de distribución.
No hay datos para analizar.
es la línea Columna (varB) dentro de la distribución.
Gracias,
Alex (en Jmp 8)
RuntheGraphs = function ({varB},
show (varB);
Distribución(
Escalado uniforme (0),
Distribución continua (
Columna (varB),
Diseño horizontal (1),
Vertical (0),
Eje de cuenta (1),
Mostrar recuentos (1),
Diagrama de caja atípica (0)
)
Donde (: IPRO_TPT_Completed == 1)
)/*distribución*/
);
c = "Hoja de corte";
RuntheGraphs (eval (c));
El mensaje fue editado por: alexRe: pase la columna como variable para funcionar para su uso en la distribuciónGracias a los dos. Eso es genial (si no un poco hack-ish.)Re: pase la columna como variable para funcionar para su uso en la distribuciónSegundo intento:
Re: pase la columna como variable para funcionar para su uso en la distribuciónEste es un problema común que encuentro en JSL. Cuando todo lo demás falla, construyo una expresión y luego uso eval (parse ()) en ella. Aquí hay un código de trabajo:
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> Ejecutar los gráficos
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> =
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: rgb (0, 0, 221);"> Función
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> (
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
{ varB }
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">,
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "">
style = "font-size: 10pt; font-family:" Courier New "; color: rgb (0, 0, 221);"> Mostrar
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> (
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
varB )
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">;
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "">
dist_expr
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> =
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;"> "
style = ""> Distribución(
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;">
style = "">
Uniforme
Escalado (0),
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;">
style = "">
Continuo
Distribución(
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;">
style = "">
Columna("
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> ||
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = ""> varB
style = "">
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> ||
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;"> "),
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;">
style = "">
Horizontal
Diseño (1),
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;">
style = "">
Vertical(
0),
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;">
style = "">
Contar
Eje (1),
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;">
style = "">
Show
Cuentas (1),
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;">
style = "">
Parte aislada
Cuadro de caja (0)
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;">
style = "">
)
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;">
style = "">
Dónde(
: sexo == \! "F \!" )
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;">
style = "">
) "
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">;
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "">
style = "font-size: 10pt; font-family:" Courier New "; color: rgb (0, 0, 221);"> eval
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> (
style = "font-size: 10pt; font-family:" Courier New "; color: rgb (0, 0, 221);"> parse
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> (
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> dist_expr ))
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">;
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">)
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">;
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> dt
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> =
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: rgb (0, 0, 221);"> abierto
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> (
style = "font-size: 10pt; font-family:" Courier New "; color: purple;"> "$ sample_data \ big
class.jmp "
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">)
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">;
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> c
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> =
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;"> "altura"
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">;
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> Ejecutar los gráficos (
do )
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">;
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
Re: pase la columna como variable para funcionar para su uso en la distribución¡Tengo el libro abierto ahora mismo!
Me puedes dar la pagina
(Parece que hiciste un put y pasado, pero se perdió en el html)Re: pase la columna como variable para funcionar para su uso en la distribuciónHola Alex:
Saltar a JMP Scripting
Por: Wendy Murphrey y Rosemary Lucas
https://support.sas.com/pubscat/bookdetails.jsp?catid=1&pc=61733
Dé un ejemplo:
<-
/ * Solución 9.2 * /
/ * Abra la tabla de datos de muestra de FitnessNi. * /
dt = Abrir ("$ SAMPLE_DATA / Fitness.jmp");
/ * Asignar los criterios a una variable global. * /
selVar = "M";
yvar = "MaxPulse";
xvar = "RstPulse";
/ * Construye la expresión principal. * /
bivExpr = Expr (
Bivariada
Y (: Expr (yvar)),
X (: Expr (xvar)),
/ * Identifique la variable global envolviéndola con la función Expr. * /
Donde (: sex == Expr (selVar))
)
);
/ * Resuelve primero la expresión de variable global. Luego resuelve la expresión principal. * /
Eval (Eval Expr (bivExpr));
Adaptándote a tu ejemplo particular:
dt = Abrir ("$ sample_data / Big Class.jmp");
/ * Asignar los criterios a una variable global. * /
c = "Altura";
/ * Construye la expresión principal. * /
dist = Expr (Distribución (
Distribución continua (
/ * Identifique la variable global envolviéndola con la función Expr. * /
Columna (: Expr (c)),
Diseño horizontal (1),
Vertical (0),
Distribución de ajuste (normal)
)
)
);
/ * Resuelve primero la expresión de variable global. Luego resuelve la expresión principal. * /
Eval (Eval Expr (dist));
->
Atentamente,
-Mate
Comments
There are no comments yet