Re: [R] Difficulty importing data from PARI/GP

2012-12-21 Thread arun
Cc: Sent: Friday, December 21, 2012 12:39 PM Subject: [R] Difficulty importing data from PARI/GP I'm trying to import a matrix created in PARI/GP into R but am having problems. The data in the text file has entries separated by commas but the rows themselves are separated by semicolons rathen t

Re: [R] Difficulty importing data from PARI/GP

2012-12-21 Thread William Dunlap
, December 21, 2012 12:51 PM > To: murfs > Cc: r-help@r-project.org > Subject: Re: [R] Difficulty importing data from PARI/GP > > One way is to use 'readLines' to read in the file, change the ';

Re: [R] Difficulty importing data from PARI/GP

2012-12-21 Thread jim holtman
One way is to use 'readLines' to read in the file, change the ';' to '\n', write the file out and then read it back in: > x <- readChar('/temp/test.txt', 1e6) > print(x) [1] "1,2,3,4,5,6;1,2,3,4,5,6;1,2,3,4,5,6;1,2,3,4,5,6;1,2,3,4,5,6;1,2,3,4,5,6;1,2,3,4,5,6;1,2,3,4,5,6;1,2,3,4,5,6;1,2,3,4,5,6;1,

[R] Difficulty importing data from PARI/GP

2012-12-21 Thread murfs
I'm trying to import a matrix created in PARI/GP into R but am having problems. The data in the text file has entries separated by commas but the rows themselves are separated by semicolons rathen than being on a new line. Is there a way to get R to recognise that ";" means start a new row ? -