xts
xts copied to clipboard
[R-Forge #1548] periodicity yields inconsistent frequency for 'minutes'
Submitted by: Alexander Sergeev Assigned to: Nobody R-Forge link
periodicity$frequency yields number of minutes when it guesses periodicity to be in minutes and seconds otherwise which might lead to potential problems.
> periodicity(xts(c(1:2), order.by=(Sys.time() + c(1:2)*60*5)))$frequency
[1] 5
> periodicity(xts(c(1:2), order.by=(Sys.time() + c(1:2)*3600*5)))$frequency
[1] 18000
This change could break things. Make a test for this line in FinancialInstrument and see if it fails. Possibly add a new field to the periodicity() output (e.g. units_frequency that will be in the units of the result and not always seconds).