How can I force a subset data table into a single element list?<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Hi,
I have an existing script that can plot outputs by user selected grouping variables. There are several actions taken by the script, and the typical case is there is more than one group in the grouping variable. I've noticed my script throws an error when the number of groups equals 1, and this is because when i subset the data table by group, the variable containing the subset data table is no longer a list, even though it was previously declared as a list. If there are 2 or more groups, the list is maintained. I could programmatically account for this, but its kind of a long script and i was hoping to force it as a list. Is this possible? Example attached.
I'm using JMP 10.
Thanks,
Mike
Re: How can I force a subset data table into a single element list?Thanks PMRoz & Byron for your help.
-Mike
Re: How can I force a subset data table into a single element list?In JMP 10 you could add the following logic to convert it back to a list:
if (type(mytablelist1) == "Table",
tmp_list = {};
insertinto(tmp_list, mytablelist1);
mytablelist1 = tmp_list;
);
Re: How can I force a subset data table into a single element list?Although this isn't necessarily a convenient answer, in JMP11 this doesn't seem to be an issue and the script runs completely.
Log looks good too:
myTableList1 = {DataTable("Subset of Crops")};
myTableList2 = {DataTable("Subset of Crops 1"), DataTable("Subset of Crops 2")};