Re: [R] the quote problem with readLines()

2009-03-19 Thread Dongyan Song
Hi Jim, Finally, I got the result I want, thanks a lot! Best, Dongyan jholtman wrote: > > Check out this reference: > > http://tolstoy.newcastle.edu.au/R/e2/help/07/02/9709.html > > > > On Wed, Mar 18, 2009 at 11:16 AM, Dongyan Song > wrote: >> >> Hi Jim, >> >> Thank you very much! I wil

Re: [R] the quote problem with readLines()

2009-03-18 Thread jim holtman
Check out this reference: http://tolstoy.newcastle.edu.au/R/e2/help/07/02/9709.html On Wed, Mar 18, 2009 at 11:16 AM, Dongyan Song wrote: > > Hi Jim, > > Thank you very much! I will try to sample them then. > > Best, > Dongyan > > > jholtman wrote: >> >> The amount of data that you want to rea

Re: [R] the quote problem with readLines()

2009-03-18 Thread Dongyan Song
Hi Jim, Thank you very much! I will try to sample them then. Best, Dongyan jholtman wrote: > > The amount of data that you want to read in (136M numbers) will > require about 1GB of memory (8 bytes per number for floating point - > truncation does not reduce this number of bytes). So if you

Re: [R] the quote problem with readLines()

2009-03-18 Thread jim holtman
The amount of data that you want to read in (136M numbers) will require about 1GB of memory (8 bytes per number for floating point - truncation does not reduce this number of bytes). So if you want to read it all in, then find a 64-bit version of R and probably at least 4GB of memory for your proc

Re: [R] the quote problem with readLines()

2009-03-18 Thread Dongyan Song
Hi, Thank you for your concern! The file has 136,047,472 lines, with one value in each line, and is 1.7G in size. I run in a Linux (OpenSuse OS) with 4G memory in total. The error message is Error: cannot allocate vector of size 2.0 Gb. And the worst thing is even if I read all the data into R

Re: [R] the quote problem with readLines()

2009-03-17 Thread jim holtman
readLines is doing exactly what you are asking: Value A character vector of length the number of lines read. You still have to convert the character strings to numeric. Exactly how large is "quite large"? What system are you running on? How much memory do you have? What is the error message t

[R] the quote problem with readLines()

2009-03-17 Thread Dongyan Song
Dear all, I read a file with all numbers with readLines function, as below, > f <- file("data.txt") > a <- readLines(f) but all the values in a are in format "", and I cannot do the calculation with them since they are not numeric. I wonder how should I skip those quotes, thank you for help!