This help topic is for R version 1.7.1. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/data.matrix.html
data.matrix {base}R Documentation

Data Frame to Numeric Matrix

Description

Return the matrix obtained by converting all the variables in a data frame to numeric mode and then binding them together as the columns of a matrix. Factors and ordered factors are replaced by their codes.

Usage

data.matrix(frame)

Arguments

frame

a data frame whose components are logical vectors, factors or numeric vectors.

References

Chambers, J. M. (1992) Data for models. Chapter 3 of Statistical Models in S eds J. M. Chambers and T. J. Hastie, Wadsworth \& Brooks/Cole.

See Also

as.matrix, codes, data.frame, matrix.


[Package base version 1.7.1 ]