r - Convert the data frame to time series- Error NROW(x) must match length(order.by) -


while converting data frame timeseries facing following error:

code:

tszillowdata <-xts(zillowdata[,2:length(zillowdata)],                    order.by=as.date(as.character(zillowdata$time.line),                                     format='%m/%d/%y')) 

error:

error in xts(zillowdata[, 2:length(zillowdata)], order.by = as.date(as.character(zillowdata$time.line),  :    nrow(x) must match length(order.by) 

code:

tszillowdata <-xts(zillowdata[,-1],                    order.by=as.date(as.character(zillowdata$time.line),                                     format='%m/%d/%y')) 

error:

error in xts(zillowdata[, -1], order.by = as.date(as.character(zillowdata$time.line),  :    nrow(x) must match length(order.by) 

can me in converting this?
have attached snapshot of how data frame looks: data-frame picture


Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -