Check if Vector and if so, Convert to Row Matrix

vec_to_mat(x)

Arguments

x

vector or matrix

Value

matrix

Examples

vec_to_mat(c(1,2,3))
#> [,1] [,2] [,3] #> [1,] 1 2 3
vec_to_mat(rbind(c(1,2,3), c(1,2,3)))
#> [,1] [,2] [,3] #> [1,] 1 2 3 #> [2,] 1 2 3