For the latest version of JMP Help, visit JMP.com/help.


Scripting Guide > Data Structures > Lists > Insert a Nested List in an Existing List
Publication date: 04/30/2021

Insert a Nested List in an Existing List

To insert a nested list in an existing list, specify the placement of the list as follows:

list2 = {{"a", "b"}, {"c", "d"}};
list2[3] = {"apple", "banana"}; // specify a list as the third item
Show( list2 );

list2 = {{"a", "b"}, {"c", "d"}, {"apple", "banana"}};

If you do not know the number of items in a list, use N Items(). In this example, an empty list is inserted at the end of the list.

list1 = {"a", "b"};
list1[N Items( list1 ) + 1] = {};
Show( list1 );

list1 = {"a", "b", {}};

Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).