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

> ### Name: spsample-methods
> ### Title: Spatial Sampling of Compact Strata
> ### Aliases: spsample spsample,CompactStratification,missing,missing-method
> ###   spsample,CompactStratification,numeric,missing-method
> ###   spsample,CompactStratificationEqualArea,numeric,character-method
> ###   spsample,CompactStratificationPriorPoints,missing,missing-method
> ### Keywords: methods
> 
> ### ** Examples
> 
> # Note: the example below requires the 'rgdal'-package.
> # You may consider the 'maptools'-package as an alternative
> if (require(rgdal)) {
+ 
+     # read a vector representation of the `Farmsum' field
+     shpFarmsum <- readOGR(
+         dsn = system.file("maps", package = "spcosa"),
+         layer = "farmsum"
+     )
+ 
+     # stratify `Farmsum' into 50 strata
+     # NB: increase argument 'nTry' to get better results
+     set.seed(314)
+     myStratification <- stratify(shpFarmsum, nStrata = 50, nTry = 1)
+ 
+     # sample two sampling units per stratum
+     mySamplingPattern <- spsample(myStratification, n = 2)
+ 
+     # plot the resulting sampling pattern on
+     # top of the stratification
+     plot(myStratification, mySamplingPattern)
+ 
+ }
Loading required package: rgdal
Loading required package: sp
rgdal: version: 1.4-3, (SVN revision 828)
 Geospatial Data Abstraction Library extensions to R successfully loaded
 Loaded GDAL runtime: GDAL 2.2.4, released 2018/03/19
 Path to GDAL shared files: /usr/share/gdal
 GDAL binary built with GEOS: TRUE 
 Loaded PROJ.4 runtime: Rel. 4.9.3, 15 August 2016, [PJ_VERSION: 493]
 Path to PROJ.4 shared files: (autodetected)
 Linking to sp version: 1.3-1 
OGR data source with driver: ESRI Shapefile 
Source: "/data/gannet/ripley/R/packages/tests-clang/spcosa.Rcheck/spcosa/maps", layer: "farmsum"
with 1 features
It has 4 fields
Error in Ops.unit(e2) : 
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
Calls: <Anonymous> ... f -> render_axis -> guide_axis -> Ops.unit -> Ops.unit
Execution halted