function vectorWithDType( arg, dtype, options ) {
	var opts;
	var buf;

	// Note: in all of the following, we delegate option validation to the ndarray constructor...
	if ( options === null ) {
		opts = {};
	} else {
		opts = options;
	}
	// Case: vector( length )
	if ( isNonNegativeInteger( arg ) ) {
		buf = buffer( dtype, arg );
		return new ndarray( dtype, buf, [ buf.length ], [ 1 ], 0, resolveOrder( opts ), opts );
	}
	// Case: vector( Buffer )
	if ( isBuffer( arg ) ) {
		if ( isGenericDataType( dtype ) ) {
			buf = copy( arg );
		} else if ( isBinaryDataType( dtype ) ) {
			buf = copyBuffer( arg );
		} else {
			buf = typedarray( arg, dtype );
		}
		return new ndarray( dtype, buf, [ buf.length ], [ 1 ], 0, resolveOrder( opts ), opts );
	}
	// Case: vector( collection )
	if ( isCollection( arg ) ) {
		if ( isGenericDataType( dtype ) ) {
			buf = copy( arg );
		} else if ( isBinaryDataType( dtype ) ) {
			buf = array2buffer( arg ); // note: we assume that `arg` is an array of octets
		} else {
			buf = typedarray( arg, dtype );
		}
		return new ndarray( dtype, buf, [ buf.length ], [ 1 ], 0, resolveOrder( opts ), opts );
	}
	// Case: vector( ArrayBuffer )
	if ( isArrayBuffer( arg ) ) {
		return arraybuffer2vector( dtype, arg, arg.byteLength/bytesPerElement( dtype ), 1, 0, resolveOrder( opts ), opts );
	}
	// Case: vector( Iterable )
	if ( isIterableLike( arg ) ) {
		buf = arg[ ITERATOR_SYMBOL ]();
		buf = iterator2array( buf );
		if ( isBinaryDataType( dtype ) ) {
			buf = array2buffer( buf );
		} else if ( !isGenericDataType( dtype ) ) {
			buf = typedarray( buf, dtype );
		}
		return new ndarray( dtype, buf, [ buf.length ], [ 1 ], 0, resolveOrder( opts ), opts );
	}
	// Case: vector( options )
	if ( options === null && isPlainObject( arg ) ) {
		buf = buffer( dtype, 0 );
		return new ndarray( dtype, buf, [ buf.length ], [ 1 ], 0, resolveOrder( arg ), arg );
	}
	return null;
}
Returns a vector having a specified data type.

@private
@param {(NonNegativeInteger|Collection|ArrayBuffer|Buffer|Iterable|Options)} arg - length, typed array, array-like object, buffer, iterable, or options object
@param {string} dtype - data type
@param {(Options|null)} options - function options
@param {boolean} [options.readonly=false] - boolean indicating whether to return a read-only ndarray
@param {string} [options.mode='throw'] - specifies how to handle indices which exceed ndarray dimensions
@returns {(ndarray|null)} one-dimensional ndarray

@example
var getDType = require( '@stdlib/ndarray/dtype' );
var numel = require( '@stdlib/ndarray/numel' );

var v = vectorWithDType( 10, 'float64', {} );
// returns <ndarray>

var len = numel( v );
// returns 10

var dt = getDType( v );
// returns 'float64'

@example
var getDType = require( '@stdlib/ndarray/dtype' );
var numel = require( '@stdlib/ndarray/numel' );

var v = vectorWithDType( [ 1, 2, 3, 4 ], 'generic', {} );
// returns <ndarray>

var len = numel( v );
// returns 4

var dt = getDType( v );
// returns 'generic'

@example
var getDType = require( '@stdlib/ndarray/dtype' );
var numel = require( '@stdlib/ndarray/numel' );
var ArrayBuffer = require( '@stdlib/array/buffer' );

var buf = new ArrayBuffer( 32 );
var v = vectorWithDType( buf, 'float64', {} );
// returns <ndarray>

var len = numel( v );
// returns 4

var dt = getDType( v );
// returns 'float64'

@example
var getDType = require( '@stdlib/ndarray/dtype' );
var numel = require( '@stdlib/ndarray/numel' );

var v = vectorWithDType( {}, 'float64', null );
// returns <ndarray>

var len = numel( v );
// returns 0

var dt = getDType( v );
// returns 'float64'

@example
var getDType = require( '@stdlib/ndarray/dtype' );
var numel = require( '@stdlib/ndarray/numel' );
var array2iterator = require( '@stdlib/array/to-iterator' );

var v = vectorWithDType( array2iterator( [ 1, 2, 3, 4 ] ), 'generic', {} );
// returns <ndarray>

var len = numel( v );
// returns 4

var dt = getDType( v );
// returns 'generic'