Trying to adapt the examples from here: An Introduction to origin-destination data
Data I'm trying to work with looks like this (3 columns, 6 rows),
structure(list(Shed.x = c(3, 3, 8, 8, 8, 8), Shed.y = c(3, 29,
39, 74, 83, 84), Num = c(1, 1, 1, 1, 1, 1)), row.names = c(NA,
6L), class = "data.frame")
Table is product of two dplyr left_joins.. But I keep getting:
Error in out[cbind(x[[name_orig]], x[[name_dest]])] <- x[[attrib]] :
subscript out of bounds
In response to:
od_to_odmatrix(x, attrib = "Num", name_orig = "Shed.x", name_dest = "Shed.y")
Seems relevant: Creating origin-destination matrices with Rcount-origin-destination-relationships-without-direct-with-r
The igraph package generates a square/symmetical matrix (which seems to be what I want/need), but not sure how it plays with the rest of the OD library. Igraph library