Create sparse diagonal matrix with vector x on diagonal

spDiag(v)

Arguments

v

Vector to use as the diagonal of the matrix