Names Default To Here( 1 );
dt = New Table( "Example",
Add Rows( 15 ),
New Column( "sex",
Character,
"Nominal",
Set Values(
{"F", "F", "F", "F", "F", "M", "M", "M", "F", "F", "F", "M", "M", "M",
"M"}
)
),
New Column( "height",
Numeric,
"Continuous",
Format( "Best", 10 ),
Set Values( [59, 61, 55, 66, 52, 60, 61, 51, 60, 61, 56, 65, 63, 58, 59] )
),
New Column( "weight",
Numeric,
"Continuous",
Format( "Best", 10 ),
Set Values(
[95, 123, 74, 145, 64, 84, 128, 79, 112, 107, 67, 98, 105, 95, 79]
)
),
Set Row States(
[192, 193, 193, 193, 193, 32833, 32833, 32832, 192, 192, 192, 32832, 32832,
32832, 32832]
)
);
// Here is the Bivariate Platform. It will honor the rowstates
// I have provided some selections, etc. but you can change them
// to whatever selections you want
Bivariate(
Y( :height ),
X( :weight ),
Fit Where( :sex == "F", Fit Line( {Line Color( "Medium Dark Red" )} ) ),
Fit Where( :sex == "M", Fit Line( {Line Color( "Medium Dark Blue" )} ) )
);
// Here is the code to create the new rowstate column
// But it can easily be done manually by just creating a new
// column, and then going to the Col Info window, and setting the
// data type to Row State
dt << New Column( "The RowStates", rowstate );
// This is the command that copies the rowstates from the
// rowstate column, to the new column called The RowStates
// To do this interactively just go to the column panel and
// right click on the red star in front of the new column
// and select "Copy From Rowstates"
dt:The RowStates << copy from rowstates;
// dt:The RowStates << Hide(1); // This will hide the column from view
// The rest is manual(interactive);
// Go to the red triangle on the Bivariate output and select
// Save Script==>To Data Table
// Once it is saved, Go to the green triangle in front of the script that was just
// saved to the data table. Right click on the green triangle and select Edit
// Now add the following line as the first line
// :The RowStates << Copy to Row states;
// Make sure you remove the // from the front of the line
// Now, whenever you run the script, the row states from when you created the graph
// will be applied before the graph is created
Jim