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:
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
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
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
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