Martin,

You could use `getQuote` to do this a little less manually.

> getSymbols("SPY", from='2011-10-31')
[1] "SPY"

> getQuote("SPY")
             Trade Time   Last Change % Change   Open   High     Low
 Volume
SPY 2011-11-03 11:44:00 125.07   1.08   +0.87% 125.27 125.42 123.595
133878480

> SPY <- rbind(SPY, xts(getQuote("SPY")[,c(5,6,7,2,8,2)], Sys.Date()))
> SPY
           SPY.Open SPY.High SPY.Low SPY.Close SPY.Volume SPY.Adjusted
2011-10-31   127.16   128.62 125.320    125.50  227863700       125.50
2011-11-01   122.03   123.51 121.520    122.00  415376200       122.00
2011-11-02   123.83   124.40 122.790    123.99  244717600       123.99
2011-11-03   125.27   125.42 123.595    125.07  133878480       125.07

Cheers,
Garrett

On Mon, Oct 31, 2011 at 8:10 AM, Brian G. Peterson <brian@braverock.com>wrote:

>
> On Mon, 2011-10-31 at 13:58 +0100, Martin Bauer wrote:
> > Hi Brian,
> >
> > yes rbind finally but I thinking of something like this - not sure if
> that could lead to a solution
>
>
> <snipped because it doesn't make any sense>
>
> > I'm lost at this point
>
> Clearly.
>
> > getSymbols('SPY')
> [1] "SPY"
> > tail(SPY)
>           SPY.Open SPY.High SPY.Low SPY.Close SPY.Volume SPY.Adjusted
> 2011-10-21   123.09   124.12  122.72    123.97  278872100       123.97
> 2011-10-24   124.17   125.80  124.06    125.49  202862400       125.49
> 2011-10-25   124.89   124.95  122.78    123.05  268433100       123.05
> 2011-10-26   124.35   124.77  122.21    124.30  288818700       124.30
> 2011-10-27   127.63   129.42  124.32    128.63  389788900       128.63
> 2011-10-28   128.00   128.85  127.80    128.60  225638800       128.60
>
> >SPY<-rbind(SPY,xts(matrix(c(126.5,126.6,126.425,126.55,NA,NA),nrow=1),
> order.by=as.Date(Sys.Date())))
>
> > tail(SPY)
>           SPY.Open SPY.High SPY.Low SPY.Close SPY.Volume SPY.Adjusted
> 2011-10-24   124.17   125.80 124.060    125.49  202862400       125.49
> 2011-10-25   124.89   124.95 122.780    123.05  268433100       123.05
> 2011-10-26   124.35   124.77 122.210    124.30  288818700       124.30
> 2011-10-27   127.63   129.42 124.320    128.63  389788900       128.63
> 2011-10-28   128.00   128.85 127.800    128.60  225638800       128.60
> 2011-10-31   126.50   126.60 126.425    126.55         NA           NA
>
> You don't need anything other than rbind and xts.
>
> --
> Brian
>
> _______________________________________________
> 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.
>

	[[alternative HTML version deleted]]

