r - Converting from Data Frame to Zoo Issue with rows/columns -


i trying convert df zoo. df has 2 columns, first date, , second values.

i use hp <- read.zoo(df, header = true, format = "%y-%m-%d", fun = as.yearmon)

when seems convert vector whereby each column has both date , value, instead of having date index.

when run head(hp) get:

jan 1991 feb 1991 mar 1991 apr 1991 may 1991 jun 1991

53051.72 53496.80 52892.86 53677.44 54385.73 55107.38

and running hp[1] gives:

jan 1991

53051.72

what doing wrong when converting?

thanks.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -