How can I make R take an xts object and divide each value of it to a corresponding (by date) value from other, bigger, xts object?
Suppose I have an xts object with sales in currency A in one xts object:
2018-01-01 200.0
2018-01-04 400.0
And I have currency exchange rate in other xts object:
2018-01-01 5.0
2018-01-02 5.5
2018-01-03 5.7
2018-01-04 6.0
2018-01-05 5.9
I want to divide each of sales values by currency rate at this day and get a resulting xts object like:
2018-01-01 40.0
2018-01-04 66.7