# How to | Combine and Rearrange Lists

The Wolfram System provides a complete data manipulation language with vast flexibility in rearranging lists with any number of elements in any kind of structure.

Set up a list of six integers with some duplicates (stored as v):

 In[1]:=
 Out[1]=

Sort the elements of the list v:

 In[2]:=
 Out[2]=

Use Union to sort v and remove any duplicates:

 In[3]:=
 Out[3]=

Note that unless you redefine v, it retains its original value:

 In[4]:=
 Out[4]=

Redefine v:

 In[5]:=
 Out[5]=
 In[6]:=
 Out[6]=

Reverse the order of v:

 In[7]:=
 Out[7]=

Rotate the elements of v two places to the left:

 In[8]:=
 Out[8]=

Rotate the elements of v two places to the right:

 In[9]:=
 Out[9]=

Pad v on the left with x to get a list of length 10:

 In[10]:=
 Out[10]=

Partition the list v into sublists of length 2:

 In[11]:=
 Out[11]=

Partition the list v into sublists of length 2 with offset 1:

 In[12]:=
 Out[12]=

Split a list into runs of identical elements:

 In[13]:=
 Out[13]=

Flatten deletes inner braces in nested lists:

 In[14]:=
 Out[14]=

Join the elements of a set of lists:

 In[15]:=
 Out[15]=