# NOT RUN {
library(ggplot2, quietly = TRUE)
library(sf, quietly = TRUE)
net = as_sfnetwork(roxel) %>%
st_transform(3035)
# Quick overview of the network in ggplot style.
autoplot(net)
# Other ggplot elements can be added.
points = net %>%
st_bbox() %>%
st_as_sfc() %>%
st_sample(10, type = 'random') %>%
st_set_crs(3035) %>%
st_cast('POINT')
autoplot(net) +
# The theme can be customized
theme_minimal() +
# Labels can be added
labs(title = 'Nice ggplot') +
# And extra sf layers can be included
geom_sf(data = points, color = 'red', size = 2)
# }
Run the code above in your browser using DataLab