[R] Query: how to add quotes when importing a txt file

2008-05-09 Thread Stefano Sofia
Dear R users, I have a txt file of the form 10092007 24.62 24.31 24.90 11092007 19.20 23.17 22.10 13092007 24.71 27.33 23.10 14092007 27.33 27.90 24.10 15092007 28.22 28.55 24.30 16092007 28.53 29.24 27.40 17092007 24.19 30.64 26.80 18092007 22.60 20.62 28.40 19092007 8.89 1.70 14.70 20092007

Re: [R] Query: how to add quotes when importing a txt file

2008-05-09 Thread Gabor Grothendieck
On Fri, May 9, 2008 at 8:52 AM, Stefano Sofia [EMAIL PROTECTED] wrote: Dear R users, I have a txt file of the form 10092007 24.62 24.31 24.90 11092007 19.20 23.17 22.10 13092007 24.71 27.33 23.10 14092007 27.33 27.90 24.10 15092007 28.22 28.55 24.30 16092007 28.53 29.24 27.40 17092007

Re: [R] Query: how to add quotes when importing a txt file

2008-05-09 Thread Michael Rennie
Hi Stefano, Why do you *need* to add the quotes to the text file? If you leave them out, any of the standard methods of reading data (i.e., read.table(filename, sep=) should work. See help(read.table), help(scan), or help(read.fwf) for more info. Mike Stefano Sofia wrote: Dear R users, I

Re: [R] Query: how to add quotes when importing a txt file

2008-05-09 Thread Jorge Ivan Velez
Hi Stefano, Take a look at ?read.table and its friends. Now, assuming that your file is data.txt you can use, for example: # Option 1 df=read.table('your.ubication.here/data.txt',header=FALSE) df # Option 2 Copy your data set in the clipboard and write this in the R Console:

Re: [R] Query: how to add quotes when importing a txt file

2008-05-09 Thread Gabor Grothendieck
Just to follow up based on offline discussion the problem is that column one values were being interpreted as numeric (since they are all numbers) so that, for example, 09122007 was interpreted as 9122007 without the leading zero. In such a case the day was regarded as 91 which, of course, can't