Try:

library(quantmod)
getSymbols("SPY")
SPY['20130116/20130123']

ISO8601 standard subsetting, and you can't make a mistake, courtesy of xts.

HTH
Jeff


On Mon, Jan 28, 2013 at 10:47 AM, Velappan Periasamy <veepsirtt@gmail.com>wrote:

> Hello,
> How to subset this data frame from "2013-01-16" to "2013-01-23")?
>
> load.packages('tseries')
>  t1<-get.hist.quote("SPY", start="2013-01-01")
>
>  t2=subset(t1,as.Date(rownames(t1))  >="2013-01-16" & as.Date( rownames(t1)
> ) <="2013-01-23")
> print(t2)
> It returns no data.
> with regards
> veepsirtt
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance@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.
>



-- 
Jeffrey Ryan
jeffrey.ryan@lemnica.com

www.lemnica.com

R/Finance 2013: Applied R in Finance
May 17, 18 Chicago, IL
www.RinFinance.com

	[[alternative HTML version deleted]]

