The dimensions of the Grid object are matched to the $d$
columns of the object given in object, in the same
order. Each column is coerced into a factor. Each combination
of the $d$ different levels must be found exactly one in the
data frame or matrix, and the the row number of that combination is
stored in the index slot of the object.