# NOT RUN {
library(cartograflow)
library(sf)
data(flowdata)
# example with the background
map <- st_read(system.file("shape/MGP_TER.shp", package = "cartograflow"))
par(bg = "NA")
plot(st_geometry(map), col = "blue")
flowmap(
tab = flows, fij = "Fij", origin.f = "i", destination.f = "j",
bkg = map,add=TRUE, code = "EPT_NUM", nodes.X = "X", nodes.Y = "Y",
filter = FALSE
)
# }
# NOT RUN {
# example with nodes files
map <- st_read("MGP_territoires.json")
pt <- read.csv2("points.csv")# points files origin destination
flows<-red.cs2("flows.csv") # flows files
par(bg = "NA")
plot(st_geometry(map), col = "blue")
flowmap(tab = flows, fij = "d", origin.f = "a", destination.f = "b",
crs=4326,nodes = pt, code = "EPT_NUM", nodes.X = "X", nodes.Y = "Y",
filter = TRUE,add=TRUE,threshold = 10, taille = 8,arr.length = 0.1)
# }
Run the code above in your browser using DataLab