While subsetting with xts you usually set the range between two dates/times e.g.
df["T08:00/T16:59"]
or
df["2012-12-12/2012-12-12"]
I wanna set the start date and get a special period: e.g 14 days. How would you solve that problem, calculating a 2nd external variable. Or is it also possible to set the range of the subset?
Example: df["2012-12-12/14days.."]
Thanks!
Try this
first(df["2012-12-12/"], "14 days")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With