[R-SIG-Finance] [R-sig-finance] xts and to.weekly function
kafkaz
kafka at centras.lt
Wed Apr 22 17:01:40 CEST 2009
I did in a similar way, but using "which" function
Josh Ulrich-2 wrote:
>
> Does this provide what you want?
>
> require(quantmod)
> getSymbols("USD/EUR",src="oanda",from="2009-01-01")
>
> # endpoints(..., on='weeks') returns Sundays
> fri <- endpoints(USDEUR, on='weeks')-2
>
> # replace first observation with zero, and remove last observation
> # see ?endpoints
> fri[1] <- 0; fri <- head(fri,-1)
>
> # data series of only Fridays
> USDEUR[fri]
>
> HTH,
> Josh
>
>
>
--
View this message in context: http://www.nabble.com/xts-and-to.weekly-function-tp23133625p23175510.html
Sent from the Rmetrics mailing list archive at Nabble.com.
More information about the R-SIG-Finance
mailing list