[R-SIG-Finance] problem with import data

FJ M chicagobrownblue at hotmail.com
Sun Apr 29 16:18:11 CEST 2012


Date,Open,High,Low,Close,Volume,Adj Close
 
I think your problem is Adj Close has a space in it. If you remove the space or replace it with underscore, I think you will be home free. You could also delete the Adj Close column -- I never use it. 
 
Good Luck
 
Frank
Chicago, IL
----------------------------------------
> Date: Sun, 29 Apr 2012 10:48:23 +0100
> From: krisanharia at gmail.com
> To: r-sig-finance at r-project.org
> Subject: Re: [R-SIG-Finance] problem with import data
>
> >
> > 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. 		 	   		  


More information about the R-SIG-Finance mailing list