{"word_count": 201, "character_count": 1341}
For practicals on networks and flows, we will use the R package flows dedicated to flows on networkslibrary(flows)data(nav)myflows &#60;- prepflows(mat = nav, i = "i", j = "j", fij = "fij")diag(myflows) &#60;- 0Select flows that represent at least 20% of the sum of outgoing flows for each urban area.flowSel1 &#60;- firstflows(mat = myflows/rowSums(myflows)*100, method = "xfirst",k = 20)Then select the dominant flows (incoming flows criterion)flowSel2 &#60;- domflows(mat = myflows, w = colSums(myflows), k = 1)flowSel &#60;- myflows * flowSel1 * flowSel2inflows &#60;- data.frame(id = colnames(myflows), w = colSums(myflows))and finally plot dominant flows mapopar &#60;- par(mar = c(0,0,2,0))sp::plot(GE, col = "#cceae7", border = NA)plotMapDomFlows(mat = flowSel, spdf = UA, spdfid = "ID", w = inflows, wid = "id",wvar = "w", wcex = 0.05, add = TRUE,legend.flows.pos = "topright",legend.flows.title = "Nb. of commuters")title("Dominant Flows of Commuters")The code to get the background map is based on the GE object, defined in that package.To go further on dominant flows read  Nystuen &#38; Dacey (1961)We will discuss in the last course, next week  two extensions that were not mentioned in the course. The first one is about congestion models. The second one is a nice application of flow to discuss sports issues in NBA (or NHL).