Skip to content

Read a csv file

2 messages · Alexandra R. M. de Almeida, Peter Ehlers

#
Alexandra,
I haven't seen an answer to your query yet, so let me give it a shot.

First, I would not use R-illegal variable names (I assume you
want 2004-12-30, etc, to be your colnames). Try replacing them
with A,B,C, etc. And delete the empty string at the start.

Then I would make sure that there are linefeeds before "091529",
etc, which I assume are your rownames.

Finally, I would use
  temp <- read.csv("the csv adress")
which will default to header = TRUE, etc.

And if that works for you (it did for me) I would check the
402111632.57 value for possible error.

Here's an abbreviated version of your file that you can test:

A,B,C,D
091529,,40797616.82,40512773.17,40476284.73
091553,,24908681.74,24814586.13,
091571,,12931770.37,12868282.58,12893857.63
091502,,54336162.2999999,54151915.56,53822069.82
126731,,26059305.54,25972063.79,25893131.09


(BTW: I don't see how you were able to read the file that you
say you could read.)

Peter Ehlers
Alexandra R. M. de Almeida wrote:
,,!