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

> ### Name: generate.transects
> ### Title: S4 generic method to generate an instance of a design
> ### Aliases: generate.transects
> ###   generate.transects,Line.Transect.Design-method
> ###   generate.transects,Point.Transect.Design-method
> 
> ### ** Examples
> 
> #Point transect example
> shapefile.name <- system.file("extdata", "TrackExample.shp", package = "dssd")
> region <- make.region(region.name = "study area",
+                      shape = shapefile.name)
> design <- make.design(region = region,
+                       transect.type = "point",
+                       design = "random",
+                       samplers = 25,
+                       design.angle = 45,
+                       edge.protocol = "minus",
+                       truncation = 3)
> # Generate a single survey instance
> survey <- generate.transects(design)
> plot(region, survey, covered.area = TRUE)
> 
> #Line transect example
> # Define the design
> design <- make.design(region = region,
+                       transect.type = "line",
+                       design = c("systematic"),
+                       line.length = 1000,
+                       design.angle = c(179),
+                       edge.protocol = "minus",
+                       truncation = 1)
> 
> # Create a single set of transects to check
> survey <- generate.transects(design)
> plot(region, survey, covered.area = TRUE)
Error in `geom_sf()`:
! Problem while converting geom to grob.
ℹ Error occurred in the 3rd layer.
Caused by error in `MtrxSetSet()`:
! polygons not (all) closed
Backtrace:
     ▆
  1. ├─base (local) `<fn>`(x)
  2. ├─ggplot2 (local) `print.ggplot2::ggplot`(x)
  3. │ ├─ggplot2::ggplot_gtable(data)
  4. │ └─ggplot2 (local) `ggplot_gtable.ggplot2::ggplot_built`(data)
  5. │   └─ggplot2:::by_layer(...)
  6. │     ├─rlang::try_fetch(...)
  7. │     │ ├─base::tryCatch(...)
  8. │     │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9. │     │ │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10. │     │ │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 11. │     │ └─base::withCallingHandlers(...)
 12. │     └─ggplot2 (local) f(l = layers[[i]], d = data[[i]])
 13. │       └─l$draw_geom(d, layout)
 14. │         └─ggplot2 (local) draw_geom(..., self = self)
 15. │           └─self$geom$draw_layer(...)
 16. │             └─ggplot2 (local) draw_layer(..., self = self)
 17. │               └─base::lapply(...)
 18. │                 └─ggplot2 (local) FUN(X[[i]], ...)
 19. │                   ├─rlang::inject(self$draw_panel(data, panel_params, coord, !!!params))
 20. │                   └─self$draw_panel(data, panel_params, coord, na.rm = FALSE, legend = "other")
 21. │                     └─ggplot2 (local) draw_panel(..., self = self)
 22. │                       ├─sf::st_as_grob(data$geometry, pch = data$shape, gp = gp, arrow = arrow)
 23. │                       └─sf:::st_as_grob.sfc(...)
 24. │                         └─sf:::st_cast_sfc_default(x)
 25. │                           └─base::lapply(x, function(x) if (inherits(x, "POLYGON")) POLYGON2MULTIPOLYGON(x) else x)
 26. │                             └─sf (local) FUN(X[[i]], ...)
 27. │                               └─sf:::POLYGON2MULTIPOLYGON(x)
 28. │                                 └─sf::st_multipolygon(list(unclass(x)), dim = dim)
 29. │                                   └─sf:::MtrxSetSet(x, dim, type = "MULTIPOLYGON", needClosed = TRUE)
 30. │                                     └─base::stop("polygons not (all) closed")
 31. └─base::.handleSimpleError(...)
 32.   └─rlang (local) h(simpleError(msg, call))
 33.     └─handlers[[1L]](cnd)
 34.       └─cli::cli_abort(...)
 35.         └─rlang::abort(...)
Execution halted