Skip to content
Prev 69465 / 398513 Next

converting an ASCII file to a matrix

Michael Graber wrote:
a) What is an R-WinEdit user?

b) I guess you mean R-WinEdt (without an i) implying the plug-in for the 
WinEdt editor? WinEdit is another editor that does not support R very 
closely, AFAIK.

c) The following questions are completely unrelated to any editor, so 
why do you ask only a very small (empty?) subset of the R community?
d) What does m[i;j] mean? If we are speaking R, I guess you mean m[i,j]?
So what aboutreading all lines, and storing separate characters as 
vectors in a list using strsplit().
   L <- strsplit(readLines(filename), "")
   L[[i]][j]

A matrix seems to be the wrong way with unequal line lengths.

Uwe Ligges