cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. ET on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
FN
FN
Level VI

duplicating elements in list

What's the easiest way to duplicate elements in a list

 

myListA = {"y"}; 

//Result I need:
myList = {"y", "y"};

// This should work with an arbitrary number of elements in the list

myListB = {"y1", "y2", "y3"}; 

//Results
myList = {"y1", "y2", "y3","y1", "y2", "y3"};

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: duplicating elements in list

Is this what you are looking for?

myListA={"y"};
myList = myListA || myListA;
Jim

View solution in original post

Re: duplicating elements in list

Another way:

 

Names Default to Here( 1 );

list = { "a", "b", "c" };

Repeat( list, 3 );

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: duplicating elements in list

Is this what you are looking for?

myListA={"y"};
myList = myListA || myListA;
Jim
FN
FN
Level VI

Re: duplicating elements in list

Re: duplicating elements in list

Another way:

 

Names Default to Here( 1 );

list = { "a", "b", "c" };

Repeat( list, 3 );

Recommended Articles