Re: [R] Reading a file in R

From: David Barron <mothsailor_at_googlemail.com>
Date: Tue 19 Sep 2006 - 10:32:44 GMT

I think that command should work (assuming that it is *comma* rather than semi-colon delimited, which is used in countries where a comma is used as a decimal point, in which case you should use read.csv2 instead). So, is your data definitely as clean as you think. Have you looked at the data in a text editor? What are the dimensions of the resulting data frame?

On 19/09/06, Mesomeris, Spyros [CIR] <spyros.mesomeris@citigroup.com> wrote:
> Dear R helpers,
>
> I am trying to read a CSV file in R called EUROPE (originally an Excel
> file which I have saved as a CSV file) using the command
>
> EUROPEDATA <- read.csv("EUROPE.csv")
>
> EUROPE.csv is basically a matrix of dimension 440*44, and has a line of
> headers, i.e. each column has a name.
>
> Using read.csv I can't load the data into R properly. Although the first
> 20 columns or so are read in properly, some of the data from the
> remaining columns are missing, eg. For Column 29, the loaded file cannot
> read the first 120 observations and puts NA in their place, whereas the
> rest of the column is read in properly! I find this really strange.
>
> I have tried to use read.table and scan commands as well, with the
> header = T option, but still the problem is not solved. Please note the
> columns are formatted in the same way, and contain numbers (apart form
> the header row).
>
> Does anybody have any idea how I can read the data properly into R?
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
=================================
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue Sep 19 20:37:42 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 19 Sep 2006 - 11:30:05 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.