xts icon indicating copy to clipboard operation
xts copied to clipboard

[R-Forge #1548] periodicity yields inconsistent frequency for 'minutes'

Open joshuaulrich opened this issue 10 years ago • 1 comments

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

joshuaulrich avatar Feb 26 '15 01:02 joshuaulrich

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).

joshuaulrich avatar Oct 16 '22 21:10 joshuaulrich