Re: [R] reading csv-data

2005-06-19 Thread Johanna Sundvik
Thank you all for your help. There was an easy solution to my problem: read.csv2(example.csv, dec=., header=TRUE) or Mean1 - as.numeric(as.character(Mean1)) -Johanna Lainaus Ivar Herfindal [EMAIL PROTECTED]: Thomas Lumley wrote: On Fri, 17 Jun 2005, Johanna Sundvik wrote:

Re: [R] reading csv-data

2005-06-17 Thread Thomas Lumley
On Fri, 17 Jun 2005, Johanna Sundvik wrote: However, this Mean1 is categorical when it should be real numbers. Mean1 [1] 4.4332 8.5113 35.1624 9.1693 2.974 65.1578 43.2241 3.1278 5.3364 Levels: 2.974 3.1278 35.1624 4.4332 43.2241 5.3364 65.1578 8.5113 9.1693 Why R does not understand

Re: [R] reading csv-data

2005-06-17 Thread Ivar Herfindal
Thomas Lumley wrote: On Fri, 17 Jun 2005, Johanna Sundvik wrote: However, this Mean1 is categorical when it should be real numbers. Mean1 [1] 4.4332 8.5113 35.1624 9.1693 2.974 65.1578 43.2241 3.1278 5.3364 Levels: 2.974 3.1278 35.1624 4.4332 43.2241 5.3364 65.1578 8.5113 9.1693

Re: [R] reading csv-data

2005-06-17 Thread Don MacQueen
In my experience, this has always been due to the presence of non-numeric values in the input. In the example you show, it is not obvious that there is any. I would start by first inspecting the input file very carefully, using a text editor outside of R. Since your example appears to have

Re: [R] reading csv-data

2005-06-17 Thread Spencer Graves
I've struggled with this myself in the past. I've recently started using the following: File - pair.txt # File name with path if different from getwd() readLines(File, n=9) The function readLines reads the first n lines as n individual character strings. From this, you