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 -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -