Skip to content

Newbie Matrix problem refined; Can't convert .csv data to matrix

2 messages · rwatkins@cornerstonelp.com, Peter Dalgaard

#
Thanks to all for your previous help.  I see now that my problem is
converting my .csv file of data into a matrix.  My example is a (3x3) matrix
with a "header" row (that doesn't contain numerics).

Thanks again for your time and gracious consideration.
#
<rwatkins at cornerstonelp.com> writes:
I believe that was actually answered in at least one of the replies
you already got, but to reiterate: Use as.matrix to coerce the data
frame returned by read.csv to a matrix. As in:
0: A,B,C
1: 1,2,3
2: 4,5,6
3: 7,8,9
4:
A   B   C
  1  30  36  42
  2  66  81  96
  3 102 126 150