positions <- as.matrix(french_cities[1:10, c("th_longitude", "th_latitude")])
distances <- french_cities_distances[1:10, 1:10] / 1000 ## convert to km
production <- rep(1, 10)
attractiveness <- log(french_cities$area[1:10])
all_flows <- grid_blvim(distances, production, seq(1.05, 1.45, by = 0.1),
seq(1, 3, by = 0.5) / 400,
attractiveness,
bipartite = FALSE,
epsilon = 0.1, iter_max = 1000,
destination_data = list(
names = french_cities$name[1:10],
positions = positions
),
origin_data = list(
names = french_cities$name[1:10],
positions = positions
)
)
ggplot2::autoplot(all_flows, with_names = TRUE) +
ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 90))
ggplot2::autoplot(all_flows, with_names = TRUE, normalisation = "none") +
ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 90))
ggplot2::autoplot(all_flows,
flow = "destination", with_names = TRUE,
qmin = 0, qmax = 1
) +
ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 90))
ggplot2::autoplot(all_flows,
flow = "destination", with_positions = TRUE,
qmin = 0, qmax = 1
) + ggplot2::scale_size_continuous(range = c(0, 6)) +
ggplot2::coord_sf(crs = "epsg:4326")
ggplot2::autoplot(all_flows,
flow = "destination", with_positions = TRUE,
qmin = 0, qmax = 1,
cut_off = 1.1
) +
ggplot2::coord_sf(crs = "epsg:4326")
ggplot2::autoplot(all_flows,
flow = "destination", with_positions = TRUE,
with_names = TRUE,
with_labels = TRUE,
qmin = 0, qmax = 1,
cut_off = 1.1
) +
ggplot2::coord_sf(crs = "epsg:4326")
Run the code above in your browser using DataLab