Assign character names to input variables (data matrix columns):
dimnames(x) <- vnames(x,names)
Required arguments:
x = data matrix.
names = vector of character names for columns of x.
length(names) must equal ncol(x).
Each name can be at most ten characters.
Example:
dimnames(xdata) <- vnames(xdata,c("sex","age","occup","educat","income"))
Remarks:
There are a variety of ways in S to assign character names to columns (and
rows) of a matrix. This function is provided for convenience.