Gets the dimensions of the input a, returning c(length(a), 1) if dim(a) == NULL.
a
c(length(a), 1)
dim(a) == NULL
gdim(a)