Last updated on 2025-09-21 21:49:12 CEST.
Package | ERROR | OK |
---|---|---|
MapGAM | 1 | 12 |
Current CRAN status: ERROR: 1, OK: 12
Version: 1.3-1
Check: examples
Result: ERROR
Running examples in ‘MapGAM-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: trimdata
> ### Title: Trim a Data Set To Map Boundaries
> ### Aliases: trimdata
> ### Keywords: misc
>
> ### ** Examples
>
>
> # This example uses the "sf" package to read in an external ESRI shapefile for Maine
> if (require(sf)) {
+ # download example shapefile zip from github, and unzip
+ zippath <- paste(tempdir(),"Income_schooling.zip",sep="/")
+ download.file("https://github.com/mgimond/Spatial/raw/main/Data/Income_schooling.zip",
+ destfile = zippath, mode='wb')
+ unzip(zippath, exdir = tempdir())
+
+ # read shapefile into sf format
+ shppath <- paste(tempdir(),"Income_schooling.shp",sep="/")
+ basemap0 <- st_read(shppath)
+
+ # Create example data by randomly sampling within bounding box
+ rs <- st_bbox(basemap0) # get ranges of X and Y
+ MEdata <- data.frame(X=runif(300,rs[1],rs[3]), Y=runif(300,rs[2],rs[4]))
+ plot(basemap0["NAME"], reset=FALSE)
+ plot(st_as_sf(MEdata,coords=1:2), add=TRUE) # plot data in black
+
+ # trim data to basemap, and plot trimmed data with red X's
+ dME <- trimdata(MEdata, basemap0)
+ plot(st_as_sf(dME,coords=1:2), col="red", pch="X", add=TRUE)
+ dev.off() # clear map settings
+ }
Loading required package: sf
Linking to GEOS 3.14.0, GDAL 3.11.4, PROJ 9.6.2; sf_use_s2() is TRUE
trying URL 'https://github.com/mgimond/Spatial/raw/main/Data/Income_schooling.zip'
Warning in download.file("https://github.com/mgimond/Spatial/raw/main/Data/Income_schooling.zip", :
URL 'https://github.com/mgimond/Spatial/raw/main/Data/Income_schooling.zip': status was 'Could not connect to server'
Error in download.file("https://github.com/mgimond/Spatial/raw/main/Data/Income_schooling.zip", :
cannot open URL 'https://github.com/mgimond/Spatial/raw/main/Data/Income_schooling.zip'
Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc