Re: [R] reading a dense file of binary number

2011-10-18 Thread David L Carlson
5 PM To: Brian Tsai Cc: r-help@r-project.org Subject: Re: [R] reading a dense file of binary number Hi Brian, Take a look at ?scan > x <- scan(file.choose(), what = 'list') Read 3 items > x [1] "010101001110101" "10101001010" "01001010010"

Re: [R] reading a dense file of binary number

2011-10-18 Thread Jorge I Velez
Hi Brian, Take a look at ?scan > x <- scan(file.choose(), what = 'list') Read 3 items > x [1] "010101001110101" "10101001010" "01001010010" > as.matrix(x) [,1] [1,] "010101001110101" [2,] "10101001010" [3,] "01001010010" HTH, Jorge On Tue, Oct 18, 2011 at 3:09 PM, Brian Ts

Re: [R] reading a dense file of binary number

2011-10-18 Thread R. Michael Weylandt
Would readLines() work? Michael On Tue, Oct 18, 2011 at 3:09 PM, Brian Tsai wrote: > hi all, > > i have a file of the following format that i want to read into a matrix: > > 010101001110101 > 10101001010 > 01001010010 > ... > > it has no headers or row names. > > I tried to use read.tabl

[R] reading a dense file of binary number

2011-10-18 Thread Brian Tsai
hi all, i have a file of the following format that i want to read into a matrix: 010101001110101 10101001010 01001010010 ... it has no headers or row names. I tried to use read.table(), but it doesn't allow me to specify nothing as the column separator (specifying sep='' means whitespac