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
, 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 ';
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,
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 ?
-
4 matches
Mail list logo