[R] Reading a file in R

Mesomeris, Spyros [CIR] spyros.mesomeris at citigroup.com
Tue Sep 19 12:11:58 CEST 2006


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?



More information about the R-help mailing list