(function(define) {'use strict';
define(function(require) {

return function(loader) {
   var Variable, List;

   Variable = loader.getClass('Variable');
   List     = loader.getClass('List');

   /**
    * Splits a `Dataset` into a `List` of sub-datasets, based on a set of
    * subsets of the rows.  `select` can be
    *  - a `List` whose elements are one-dimensional collections of row indices
    *  - a factor `Variable` of the appropriate length.  Any rows with the same
    *  value label will be grouped together.
    *  used to select groups of rows
    *  - a function `f(row, i)`.  Any rows with the same function value will be grouped
    *  together.
    *
    * If an empty group of rows is created by `select`, it will generate a `Dataset` with
    * zero rows.
    */
   loader.addInstanceMethod('Dataset', 'split', function split(select) {
      var that = this;
      if (typeof select === 'function') {
         select = Variable.tabulate(function(i) {
            return select(that.rowFun(i), i);
         }, 1, that.nrow, {mode: 'factor'});
      }
      if (select instanceof Variable) { select = select.which(); }
      return select.map(function(val) { return that.get(val, true); });
   });

   /** Creates a `List` of arrays of indices corresponding to the value labels. */
   loader.addInstanceMethod('Variable.FactorVar', 'which', function which() {
      var arr, levels;
      levels = this.levels();
      arr = new Variable.Vector(function() { return []; }, levels.length).get();
      this.values.each(function(c, i) { arr[c - 1].push(i); });
      return new List(arr).names(levels);
   });
};

});

}(typeof define === 'function' && define.amd ? define : function(factory) {
   'use strict';
   module.exports = factory(require);
}));

@@ -205,17 +205,16 @@
  * Split
-s
  a %60Data
@@ -262,16 +262,21 @@
  on 
-a set of
+the specified
 %0A   
@@ -315,16 +315,17 @@
 %60 can be
+:
 %0A    *  
@@ -326,17 +326,17 @@
    *  - 
-a
+A
  %60List%60 
@@ -406,17 +406,17 @@
    *  - 
-a
+A
  factor 
@@ -433,137 +433,102 @@
  of 
-the appropriate length.  Any rows with the same%0A    *  value label will be grouped together.%0A    *  used to select groups of rows
+length %60nrow%60.  Rows with the same corresponding%0A    *  factor value will be grouped together.
 %0A   
@@ -533,17 +533,17 @@
    *  - 
-a
+A
  functio
@@ -562,13 +562,9 @@
 %60.  
-Any r
+R
 ows 
@@ -705,16 +705,23 @@
 nerate a
+n empty
  %60Datase
@@ -726,29 +726,8 @@
 set%60
- with%0A    * zero rows
 .%0A  
@@ -1175,16 +1175,21 @@
  /**
- Creates
+%0A    * Return
  a %60
@@ -1240,21 +1240,135 @@
 the 
-value labels.
+distribution%0A    * of the factor variable.%0A    *%0A    *     Variable.factor(%5B'a','a','b'%5D).which(); // %7B a: %5B1, 2%5D, b: %5B3%5D %7D%0A   
  */%0A

Update docs for restructure.js