Thank you very much for your help Joshua, getSymbols is great!

And, "yahoo.get.hist.quote" is in the packge"UsingR". Besides, there are many other functions just like "yahoo.get.hist.quote" and "getSymbols", in other packages, for example "fImport", I think these packages may be reorganized, so the earlier documentations online are inaccurate now. I have also read the documentation which says "yahoo.get.hist.quote" function is in the package tseries, however, it is actually in "UsingR".

Thank you again for your help.


2010-01-21 



zhucai4 



发件人： Joshua Ulrich 
发送时间： 2010-01-20  08:21:24 
收件人： zhucai4 
抄送： r-sig-finance 
主题： Re: [R-SIG-Finance] A problem about download stock data from yahoo 
 
I've never heard of the "yahoo.get.hist.quote" function, though its
documentation says it's in tseries (which it isn't).  Though
tseries::get.hist.quote does exist.
I would recommend using quantmod's getSymbols function:
library(quantmod)
x <- getSymbols("0012.HK",auto.assign=FALSE)
Please note that you must turn off auto assignment because "0012.HK"
is an illegal object name because it starts with a number.
HTH,
Josh
--
http://www.fosstrading.com
On Thu, Jan 21, 2010 at 1:32 AM, zhucai4 <zhucai4@gmail.com> wrote:
> Hello, everyone:
>
> I try to download the history data for a hongkong stock:0012.HK, using "yahoo.get.hist.quote", when I type the code:
>> library("UsingR")
>> instrument<-"0012.HK"
>> destfile<-"Henderson.csv"
>> yahoo.get.hist.quote(instrument,destfile,start=2008-1-1,end=2010-1-1,
> + quote="Close",download=TRUE,adjusted=TRUE,origin="1970-01-01", compression="d")
>
> there is an error message:
> Error in as.POSIXct.numeric(start, tz = "GMT") : 'origin' must be supplied
>
> I also try origin="1899-12-30", but the error message is still there.
>
> Did anyone encounter with this problem before ? Thank you very much for the help!
>
>
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance@stat.math.ethz.ch 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.
>

	[[alternative HTML version deleted]]

