[R] Reading Data

Philipp Pagel p.pagel at wzw.tum.de
Tue Oct 7 13:33:51 CEST 2008

> What if I need to take dates and stock names from these table...i mean I
> need to read in this table and then use if function and extratc the
> data from FOO

Not sure what exactly the problem is. Can you give an example? Of course
the first thing would be to make sure that dates are in the same format... 
And so far I don't see a good reason to use 'if' - R has extremely
flexible indexing capabilities.

> While using  the command foo['31-Mar-08'] in the below given example:
> On the left hand side I am getting the count and not
> alphabets....please suggest

Maybe your stock names in the file were numbers? Maybe you left out the
row.names parameter?

> Why m I getting this message
> data=read.table("H:/Rahul/london/david/rexcel/price1.txt",header=T,check.names=F,row.names=1)
> Error in read.table("H:/Rahul/london/david/rexcel/price1.txt", header = T,  : 
>   duplicate 'row.names' are not allowed 

The message means what it says: row names need to be unique. Apparently
yours are not. I.e. You wave multiple rows for the same stock


Dr. Philipp Pagel
Lehrstuhl für Genomorientierte Bioinformatik
Technische Universität München
Wissenschaftszentrum Weihenstephan
85350 Freising, Germany

More information about the R-help mailing list