docs: function mean( x, options ) {
  	/* jshint newcap:false */
  	var opts = {},
  		shape,
  		ctor,
  		err,
  		len,
  		dim,
  		dt,
  		d,
  		m;
  
  	if ( arguments.length > 1 ) {
  		err = validate( opts, options );
  		if ( err ) {
  			throw err;
  		}
  	}
  	if ( isMatrixLike( x ) ) {
  		dt = opts.dtype || 'float64';
  		dim = opts.dim;
  
  		// Determine if provided a vector...
  		if ( x.shape[ 0 ] === 1 || x.shape[ 1 ] === 1 ) {
  			// Treat as an array-like object:
  			return mean1( x.data );
  		}
  		if ( dim > 2 ) {
  			throw new RangeError( 'mean()::invalid option. Dimension option exceeds number of matrix dimensions. Option: `' + dim + '`.' );
  		}
  		if ( dim === void 0 || dim === 2 ) {
  			len = x.shape[ 0 ];
  			shape = [ len, 1 ];
  		} else {
  			len = x.shape[ 1 ];
  			shape = [ 1, len ];
  		}
  		ctor = ctors( dt );
  		if ( ctor === null ) {
  			throw new Error( 'mean()::invalid option. Data type option does not have a corresponding array constructor. Option: `' + dt + '`.' );
  		}
  		// Create an output matrix and calculate the means:
  		d = new ctor( len );
  		m = matrix( d, shape, dt );
  		return mean3( m, x, dim );
  	}
  	if ( isArrayLike( x ) ) {
  		if ( opts.accessor ) {
  			return mean2( x, opts.accessor );
  		}
  		return mean1( x );
  	}
  	throw new TypeError( 'mean()::invalid input argument. First argument must be either an array or a matrix. Value: `' + x + '`.' );
  }