I am trying to extract the script from a plot and save it to the data table for future use.
Below is my script for the "Analgesics" table from the "Sample Data Library", which doesn't work as I hoped.
The "print(dtp_script)" line shows the correct script.
However, the actual "plot_dt1" script saved in the data table contains only the "dtp_script" variable name, instead of the actual script. How do I save the actual script in the data table? Thanks!
dt = current data table ();
dtplot = dt << Fit Group( Oneway( Y( :pain ), X( :gender ) ),
Oneway( Y( :pain ), X( :drug ) ),
<<{Arrange in Rows( 2 )} );
dtp_script = dtplot << get script;
print (dtp_script);
dt << new script("plot_dt1", dtp_script );