melmasri / traveltimeHMM

Travel time prediction from GPS observations using an HMM
9 stars 2 forks source link

function order_states in misc.R crashes when number of observations with unordered states equals 1 #13

Closed ericgermaining closed 5 years ago

ericgermaining commented 5 years ago

When there is a single observation, param[aux,] becomes a dimensionless vector, which does not work with apply.

ericgermaining commented 5 years ago

Added drop=F to solve the issue.

if (length(aux)) 
    sorted = t(apply(param[aux, , drop=F], 1L, order))