cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar
shuey
Level I

Y Function using data table values

I'm trying to build multiple graph boxes, each one plots a Y Function that takes values from a data table. This should be an easy task however I'm not able to get the plots to show in the graph boxes. It works with hard coded numbers, but not with values from a Data Table

win = New Window("window", vlb = V List Box());
For (i=1, i <= N Rows(dt), i++,
	vlb << Append(Graph Box(Y Function((dt:M)[i] * x ,x)));
);

Any help would be much appreciated

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Y Function using data table values

If you look at the scripts that get created, you see that the values are not there

jthi_0-1750157426355.png

This is because you will have to evaluate them. Something like this should work 

Names Default To Here(1);

dt = open("$SAMPLE_DATA/Big Class.jmp");
Column(dt, "height") << Set Name("M");

nw = New Window("window", vlb = V List Box());
For Each Row(dt,
	Eval(EvalExpr(
		vlb << Append(Graph Box(Y Function(Expr(dt[Row(), "M"]) * x ,x)));
	))
);

jthi_1-1750157594825.png

 

Also use for each row when looping over data table as it is meant for it

-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: Y Function using data table values

If you look at the scripts that get created, you see that the values are not there

jthi_0-1750157426355.png

This is because you will have to evaluate them. Something like this should work 

Names Default To Here(1);

dt = open("$SAMPLE_DATA/Big Class.jmp");
Column(dt, "height") << Set Name("M");

nw = New Window("window", vlb = V List Box());
For Each Row(dt,
	Eval(EvalExpr(
		vlb << Append(Graph Box(Y Function(Expr(dt[Row(), "M"]) * x ,x)));
	))
);

jthi_1-1750157594825.png

 

Also use for each row when looping over data table as it is meant for it

-Jarmo

Recommended Articles