Generate column indices
colspec(x, cols = NULL)a data frame
a column specification
A vector of integers
cols can be a logical, numeric, or character vector
indicating which columns to extract. Or cols can be a formula
with the right-hand-side variable specifying the columns. This function
is used where ever a cols option is present throughout kdtools.