how to extract matrix from dataframe in r code example Example: data frame to matrix r data.matrix(frame, rownames.force = NA)