I am currently attempting to use the 'stplanr' package on R to analyse od matrice. I am trying to use the code 'odmatrix_to_od' to prepare my data in a table-style format but after I run the programme the following message is left:
Error in as.table.default(odmatrix) : cannot coerce to a table
I can't seem to get past this message. The data I'm using is 1299x1299, could it be that this data set is too large to process?
Hi, I have no experience with the packages but I glanced at the document now.
It seems your square od matrix is the issue. The function is supposed to transpose your data from long wise to width wise. But a square is equal sided. The documentation hints that a typical odmatrix might not have more than 3 necessary fields. But has parameters that perhaps could be used to make the function work, depending on your knowledge of your data.
This function takes a data frame representing travel between origins (with origin codes in name_orig , typically the 1st column) and destinations (with destination codes in name_dest , typically the second column) and returns a matrix with cell values (from attrib , the third column by default)