title: Identify all possible combinations of a variable, including if values are missing in R
body: <p>I'm curious about the total number of ways people could have completed a training in a 'choose your own adventure format'</p>
  
  <p>For example, there are 10 different levels to the training in total (i.e., level 1, 2 ... 10). People can complete 1:10; 10:1; 1,2,3,5,10; 2,1,3,5,4,6,7,9,8,10; or any combination of the levels using all, some, or none of the levels before taking their exit test.</p>
  
  <p><strong>I'm hoping to find a way to make these combinations into a categorical variable because I'm wondering if sequence matters in the users likelihood of passing the exit test.</strong></p>
  
  <p>I'd like to know how to do this in R, but if anyone has other creative solutions to offer regarding better ways to use sequence as a variable, I'm all ears for that too.</p>
  
  <p>Thanks!</p>