r - frequency() and cycle() of a monthly xts object returns value "1" -


i have monthly xts object, , function frequency() returns value of 1, expect 12. function cycle() not return month numbers, instead value of 1 each observation.

library('quantmod') getsymbols("gs10", src="fred") frequency(gs10) cycle(gs10) 

try this:

time(gs10) <- as.yearmon(time(gs10)) 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -