[R-SIG-Finance] problem with import data

Brian G. Peterson brian at braverock.com
Sun Apr 29 13:20:05 CEST 2012


Try:

require(quantmod)
?getSymbols

it will save you a lot of hassle.

On Sun, 2012-04-29 at 10:48 +0100, krisan haria wrote:
> >
> > Hi,
> >
> > Im trying to import data from yahoo into R. I downloaded the data from
> > yahoo into a csv file and then saved the csv file into a txt file (tab
> > delimited).
> >
> > From R I then call the function
> >
> > read.table("t1.txt")
> >
> > but I get the following error
> >
> > Error in scan(file, what, nmax, sep, dec, quote, skip, nlines,
> > na.strings,  :
> >   line 2 did not have 8 elements
> >
> > I tried
> >
> > read.table("t1.txt", header=T)
> >
> > but same error
> >
> > I suspect this is linked to the fact I seem to be importing an extra
> > column but I have no idea on how to get rid of this extra column.
> >
> > My R version is R 2.13.1
> >
> > Any ideas?
> >
> > Regards
> >
> > Krisan
> >
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.

-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock



More information about the R-SIG-Finance mailing list