[R] Converting a .txt file into a matrix

cobbler_squad la.foma at gmail.com
Tue Apr 13 18:37:21 CEST 2010


I need to convert foo.txt file into as.matrix
.txt file is a single column of numbers 
(i.e.
-0.303904  
-0.889965  
-0.0270313  
-0.387125  
0.189837  
-0.14858  
-0.651178  
-0.162632  
0.449309  
)

and I need to find out the correct syntax to read in this table as.matrix

I tried as.matrix(read.table(foo.txt)), but unfortunately this just spits
the table back out..


Any of your pointers would be welcome..
-- 
View this message in context: http://n4.nabble.com/Converting-a-txt-file-into-a-matrix-tp1838718p1838718.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list