Converting a data frame to xts

后端 未结 9 924
暗喜
暗喜 2020-11-28 04:10

I\'m trying to convert a data frame to xts object using the as.xts()-method. Here is my input dataframe q:

q
                      t x  
1  2006-01-01 00:00:         


        
9条回答
  •  迷失自我
    2020-11-28 04:57

    A simple solution is to first convert the data.frame to a data.table:

    library(data.table)
    
    qxts <- as.xts(as.data.table(q))
    

提交回复
热议问题