Question for you.
Your script works perfectly fine after fixing an obvious typo:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
Y_Parameters = {"height", "weight"};
nw = New Window("Graph Builder - " || (dt << get name),
ob_group = Outline Box("Fit Group")
);
lub = Lineup Box(N Col(3));
gbs = {};
For Each({yparam}, Y_Parameters,
lub << Append(
Insert Into(gbs, Graph Builder(
Size(480, 300),
Show Control Panel(0),
Variables(X(:age), Y(Eval(yparam))),
Elements(Points(X, Y(1), Y(2), Legend(3)))
))
);
);
ob_group << Append(lub);
show(gbs);
For 'gbs'
it shows
{Graph Builder[], Graph Builder[]}
which then appends to 'lub' just fine.
I re-wrote the first script you suggested in a slightly different shape and form:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Y_Parameters = {"height", "weight"};
X_Parameter = "age";
gbF = Function( {dt, X_parameter, Y_Parameter, groupByColumnString},
groupByColumn = Column( dt, groupByColumnString );
gb = Graph Builder(
Size( 350, 200 ),
Ignore Platform Preferences( 1 ),
Show Control Panel( 0 ),
Variables( X( Column( X_Parameter ) ), Y( Column( Y_Parameter ) ), Overlay( groupByColumn ) ),
);
Return( gb );
);
lub = Lineup Box( N Col( 3 ) );
listOfGBs = {};
For Each( {Y_Parameter, index}, Y_Parameters,
Insert Into( listOfGBs, gbF( dt, X_Parameter, Y_Parameter, "sex" ) )
);
lub << Append( listOfGBs );
ob_group = Outline Box( "Fit Group" );
ob_group << Append( lub );
nw = New Window( "Graph Builder - " || (dt << get name), ob_group = Outline Box( "Fit Group" ) );
in my case 'listOfGBs' also shows as:
{Graph Builder[], Graph Builder[]}
but then on line:
lub << Append( listOfGBs );
it generates error:
Not a display in access or evaluation of 'Append' , Append( listOfGBs ) /*###*/
at line 25 in ....
Any idea why?
I'll try to play around but I'd like to keep GB in a function.