Running examples in ‘sfnetworks-Ex.R’ failed
The error most likely occurred in:

> ### Name: as_sfnetwork
> ### Title: Convert a foreign object to a sfnetwork
> ### Aliases: as_sfnetwork as_sfnetwork.default as_sfnetwork.sf
> ###   as_sfnetwork.linnet as_sfnetwork.psp as_sfnetwork.sfc
> ###   as_sfnetwork.sfNetwork as_sfnetwork.sfnetwork as_sfnetwork.tbl_graph
> 
> ### ** Examples
> 
> # From an sf object.
> library(sf, quietly = TRUE)
Linking to GEOS 3.8.1, GDAL 3.0.4, PROJ 6.3.2
> 
> # With LINESTRING geometries.
> as_sfnetwork(roxel)
# A sfnetwork with 701 nodes and 851 edges
#
# CRS:  EPSG:4326 
#
# A directed multigraph with 14 components with spatially explicit edges
#
# Node Data:     701 x 1 (active)
# Geometry type: POINT
# Dimension:     XY
# Bounding box:  xmin: 7.522622 ymin: 51.94151 xmax: 7.546705 ymax: 51.9612
             geometry
          <POINT [°]>
1 (7.533722 51.95556)
2 (7.533461 51.95576)
3 (7.532442 51.95422)
4  (7.53209 51.95328)
5 (7.532709 51.95209)
6 (7.532869 51.95257)
# … with 695 more rows
#
# Edge Data:     851 x 5
# Geometry type: LINESTRING
# Dimension:     XY
# Bounding box:  xmin: 7.522594 ymin: 51.94151 xmax: 7.546705 ymax: 51.9612
   from    to name           type                                       geometry
  <int> <int> <chr>          <fct>                              <LINESTRING [°]>
1     1     2 Havixbecker S… residen…     (7.533722 51.95556, 7.533461 51.95576)
2     3     4 Pienersallee   seconda… (7.532442 51.95422, 7.53236 51.95377, 7.5…
3     5     6 Schulte-Bernd… residen… (7.532709 51.95209, 7.532823 51.95239, 7.…
# … with 848 more rows
> 
> oldpar = par(no.readonly = TRUE)
> par(mar = c(1,1,1,1), mfrow = c(1,2))
> plot(st_geometry(roxel))
> plot(as_sfnetwork(roxel))
> par(oldpar)
> 
> # With POINT geometries.
> p1 = st_point(c(7, 51))
> p2 = st_point(c(7, 52))
> p3 = st_point(c(8, 52))
> points = st_as_sf(st_sfc(p1, p2, p3))
> as_sfnetwork(points)
# A sfnetwork with 3 nodes and 2 edges
#
# CRS:  NA 
#
# A rooted tree with spatially explicit edges
#
# Node Data:     3 x 1 (active)
# Geometry type: POINT
# Dimension:     XY
# Bounding box:  xmin: 7 ymin: 51 xmax: 8 ymax: 52
        x
  <POINT>
1  (7 51)
2  (7 52)
3  (8 52)
#
# Edge Data:     2 x 3
# Geometry type: LINESTRING
# Dimension:     XY
# Bounding box:  xmin: 7 ymin: 51 xmax: 8 ymax: 52
   from    to            x
  <int> <int> <LINESTRING>
1     1     2 (7 51, 7 52)
2     2     3 (7 52, 8 52)
> 
> oldpar = par(no.readonly = TRUE)
> par(mar = c(1,1,1,1), mfrow = c(1,2))
> plot(st_geometry(points))
> plot(as_sfnetwork(points))
> par(oldpar)
> 
> # From a linnet object.
> if (require(spatstat, quietly = TRUE)) {
+   as_sfnetwork(simplenet)
+ }
spatstat.geom 1.65-5
spatstat.core 1.65-5

spatstat 2.0-1       (nickname: ‘Caution: contains small parts’) 
For an introduction to spatstat, type ‘beginner’ 

Error: 'as.psp' is not an exported object from 'namespace:spatstat'
Execution halted