Running examples in 'plotKML-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: plotKML-method
> ### Title: Methods for plotting results of spatial analysis in Google Earth
> ### Aliases: plotKML-method plotKML plotKML,SpatialPointsDataFrame-method
> ###   plotKML,SpatialLinesDataFrame-method
> ###   plotKML,SpatialPolygonsDataFrame-method
> ###   plotKML,SoilProfileCollection-method
> ###   plotKML,SpatialGridDataFrame-method
> ###   plotKML,SpatialPixelsDataFrame-method plotKML,RasterLayer-method
> ###   plotKML,SpatialPhotoOverlay-method plotKML,STIDF-method
> ###   plotKML,STFDF-method plotKML,STSDF-method plotKML,STTDF-method
> ###   plotKML,SpatialPredictions-method
> ###   plotKML,RasterBrickSimulations-method
> ###   plotKML,SpatialVectorsSimulations-method
> ###   plotKML,SpatialMaxEntOutput-method
> ###   plotKML,RasterBrickTimeSeries-method
> ###   plotKML,SpatialSamplingPattern-method plotKML,list-method
> ###   plotKML,sf-method plotKML,stars-method
> ### Keywords: spatial methods
> 
> ### ** Examples
> 
> plotKML.env(kmz = FALSE)
$colour_scale_numeric
[1] "#2C7BB6" "#ABD9E9" "#FFFFBF" "#FDAE61" "#D7191C"

$colour_scale_factor
[1] "#E41A1C" "#377EB8" "#4DAF4A" "#984EA3" "#FF7F00" "#FFFF33" "#A65628"
[8] "#F781BF" "#999999"

$colour_scale_svar
[1] "#FEEDDE" "#FDBE85" "#FD8D3C" "#E6550D" "#A63603"

$ref_CRS
[1] "+proj=longlat +datum=WGS84 +no_defs"

$NAflag
[1] -99999

$icon
[1] "icon3.png"

$LabelScale
[1] 0.5

$size_range
[1] 0.25 2.50

$license_url
[1] "http://creativecommons.org/licenses/by/4.0/"

$metadata_sel
 [1] "idinfo.citation.citeinfo.title"                                       
 [2] "idinfo.descript.abstract"                                             
 [3] "spdoinfo.ptvctinf.sdtsterm.ptvctcnt"                                  
 [4] "idinfo.timeperd.timeinfo.rngdates.begdate"                            
 [5] "idinfo.timeperd.timeinfo.rngdates.enddate"                            
 [6] "distinfo.stdorder.digform.digtopt.onlinopt.computer.networka.networkr"
 [7] "idinfo.citation.citeinfo.othercit"                                    
 [8] "idinfo.citation.citeinfo.onlink"                                      
 [9] "idinfo.datacred"                                                      
[10] "distinfo.distrib.cntinfo.cntorgp.cntorg"                              
[11] "distinfo.stdorder.digform.digtinfo.formcont"                          
[12] "idinfo.native"                                                        

$kmz
[1] FALSE

$kml_xsd
[1] "https://schemas.opengis.net/kml/2.2.0/ogckml22.xsd"

$kml_url
[1] "https://www.opengis.net/kml/2.2/"

$kml_gx
[1] "https://www.google.com/kml/ext/2.2"

$gpx_xsd
[1] "https://www.topografix.com/GPX/1/1/gpx.xsd"

$fgdc_xsd
[1] "https://fgdcxml.sourceforge.net/schema/fgdc-std-012-2002/fgdc-std-012-2002.xsd"

$inspire_xsd
[1] "https://inspire.ec.europa.eu/schemas/common/1.0/common.xsd"

$convert
[1] ""

$gdalwarp
[1] ""

$gdal_translate
[1] ""

$python
[1] ""

$home_url
[1] "https://plotkml.r-forge.r-project.org/"

> ## -------------- SpatialPointsDataFrame --------- ##
> library(sp)
> library(rgdal)
Please note that rgdal will be retired by the end of 2023,
plan transition to sf/stars/terra functions using GDAL and PROJ
at your earliest convenience.

rgdal: version: 1.5-32, (SVN revision 1176)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 3.5.2, released 2022/09/02
Path to GDAL shared files: /usr/share/gdal
 GDAL does not use iconv for recoding strings.
GDAL binary built with GEOS: TRUE 
Loaded PROJ runtime: Rel. 9.1.0, September 1st, 2022, [PJ_VERSION: 910]
Path to PROJ shared files: /home/hornik/.local/share/proj:/usr/share/proj
PROJ CDN enabled: FALSE
Linking to sp version:1.5-0
To mute warnings of possible GDAL/OSR exportToProj4() degradation,
use options("rgdal_show_exportToProj4_warnings"="none") before loading sp or rgdal.
> data(eberg)
> coordinates(eberg) <- ~X+Y
> proj4string(eberg) <- CRS("+init=epsg:31467")
> ## subset to 20 percent:
> eberg <- eberg[runif(nrow(eberg))<.1,]
> ## Not run: 
> ##D ## bubble type plot:
> ##D plotKML(eberg["CLYMHT_A"])
> ##D plotKML(eberg["CLYMHT_A"], colour_scale=rep("#FFFF00", 2), points_names="")
> ## End(Not run)
> ## plot points with a legend:
> shape = "http://maps.google.com/mapfiles/kml/pal2/icon18.png" 
> kml.file = paste0(tempdir(), "/eberg_CLYMHT_A.kml")
> leg.file = paste0(dirname(kml.file), "/kml_legend.png")
> kml_open(kml.file)
KML file opened for writing...
> kml_layer(eberg["CLYMHT_A"], colour=CLYMHT_A, z.lim=c(20,60),
+           colour_scale=SAGA_pal[[1]], shape=shape, points_names="")
Warning in proj4string(obj) :
  CRS object has comment, which is lost in output; in tests, see
https://cran.r-project.org/web/packages/sp/vignettes/CRS_warnings.html
Reprojecting to +proj=longlat +datum=WGS84 +no_defs ...
Writing to KML...
> kml_legend.bar(x=eberg$CLYMHT_A, 
+                legend.file=leg.file,
+                legend.pal=SAGA_pal[[1]], z.lim=c(20,60))
pdf 
  2 
> kml_screen(image.file=leg.file)
> kml_close(kml.file)
Closing  /tmp/RtmpST3aAu/eberg_CLYMHT_A.kml
> 
> ## ----- sf objects with sfc_POINT geometry ----- ##
> eberg_sf <- sf::st_as_sf(eberg)
> ## Not run: 
> ##D plotKML(eberg_sf["CLYMHT_A"])
> ##D plotKML(eberg_sf["CLYMHT_A"], colour_scale = rep("#FFFF00", 2), points_names = "")
> ## End(Not run)
> 
> ## -------------- SpatialLinesDataFrame --------- ##
> data(eberg_contours)
> ## Not run: 
> ##D plotKML(eberg_contours)
> ##D ## plot contour lines with actual altitudes:
> ##D plotKML(eberg_contours, colour=Z, altitude=Z)
> ## End(Not run)
> 
> ## ---- sf objects with sfc_LINESTRING geometry ---- ##
> eberg_contours_sf <- sf::st_as_sf(eberg_contours)
> ## Not run: 
> ##D plotKML(eberg_contours_sf)
> ##D plotKML(eberg_contours_sf, colour = Z, altitude = Z)
> ## End(Not run)
> 
> ## -------------- SpatialPolygonsDataFrame --------- ##
> data(eberg_zones)
> ## Not run: 
> ##D plotKML(eberg_zones["ZONES"])
> ##D ## add altitude:
> ##D zmin = 230
> ##D plotKML(eberg_zones["ZONES"], altitude=zmin+runif(length(eberg_zones))*500)
> ## End(Not run)
> 
> ## ------ sf objects with sfc_POLYGON geometry ------ ##
> eberg_zones_sf <- sf::st_as_sf(eberg_zones)
> ## Not run: 
> ##D plotKML(eberg_zones_sf["ZONES"])
> ##D plotKML(eberg_zones_sf["ZONES"], altitude = zmin + runif(length(eberg_zones)) * 500)
> ## End(Not run)
> 
> ## -------------- SpatialPixelsDataFrame --------- ##
> library(rgdal)
> library(raster)
> data(eberg_grid)
> gridded(eberg_grid) <- ~x+y
> proj4string(eberg_grid) <- CRS("+init=epsg:31467")
> TWI <- reproject(eberg_grid["TWISRT6"])
Reprojecting to +proj=longlat +datum=WGS84 +no_defs ...
> data(SAGA_pal)
> ## Not run: 
> ##D ## set limits manually (increase resolution):
> ##D plotKML(TWI, colour_scale = SAGA_pal[[1]])
> ##D plotKML(TWI, z.lim=c(12,20), colour_scale = SAGA_pal[[1]])
> ## End(Not run)
> ## categorical data:
> eberg_grid$LNCCOR6 <- as.factor(paste(eberg_grid$LNCCOR6))
> levels(eberg_grid$LNCCOR6)
[1] "112 - Discontinuous urban fabric"   "211 - Non-irrigated arable land"   
[3] "231 - Pastures"                     "242 - Complex cultivation patterns"
[5] "311 - Broad-leaved forest"          "312 - Coniferous forest"           
[7] "313 - Mixed forest"                
> data(worldgrids_pal)
> ## attr(worldgrids_pal["corine2k"][[1]], "names")
> pal = as.character(worldgrids_pal["corine2k"][[1]][c(1,11,13,14,16,17,18)])
> LNCCOR6 <- reproject(eberg_grid["LNCCOR6"])
Reprojecting to +proj=longlat +datum=WGS84 +no_defs ...
> ## Not run: 
> ##D plotKML(LNCCOR6, colour_scale=pal)
> ## End(Not run)
> 
> ## -------------- SpatialPhotoOverlay --------- ##
> ## Not run: 
> ##D library(RCurl)
> ##D imagename = "Soil_monolith.jpg"
> ##D urlExists = url.exists("https://commons.wikimedia.org")
> ##D if(urlExists){
> ##D   x1 <- getWikiMedia.ImageInfo(imagename)
> ##D   sm <- spPhoto(filename = x1$url$url, exif.info = x1$metadata)
> ##D   # str(sm)
> ##D   plotKML(sm)
> ##D }
> ## End(Not run)
> 
> ## -------------- SoilProfileCollection --------- ##
> library(aqp)
This is aqp 1.42

Attaching package: 'aqp'

The following objects are masked from 'package:raster':

    metadata, metadata<-

> library(plyr)
> ## sample profile from Nigeria:
> lon = 3.90; lat = 7.50; id = "ISRIC:NG0017"; FAO1988 = "LXp" 
> top = c(0, 18, 36, 65, 87, 127) 
> bottom = c(18, 36, 65, 87, 127, 181)
> ORCDRC = c(18.4, 4.4, 3.6, 3.6, 3.2, 1.2)
> hue = c("7.5YR", "7.5YR", "2.5YR", "5YR", "5YR", "10YR")
> value = c(3, 4, 5, 5, 5, 7); chroma = c(2, 4, 6, 8, 4, 3)
> ## prepare a SoilProfileCollection:
> prof1 <- join(data.frame(id, top, bottom, ORCDRC, hue, value, chroma), 
+    data.frame(id, lon, lat, FAO1988), type='inner')
Joining by: id
> prof1$soil_color <- with(prof1, munsell2rgb(hue, value, chroma))
> depths(prof1) <- id ~ top + bottom
> site(prof1) <- ~ lon + lat + FAO1988 
> coordinates(prof1) <- ~ lon + lat
> proj4string(prof1) <- CRS("+proj=longlat +datum=WGS84")
> prof1
SoilProfileCollection with 1 profiles and 6 horizons
profile ID: id  |  horizon ID: hzID 
Depth range: 181 - 181 cm

----- Horizons (6 / 6 rows  |  9 / 9 columns) -----
           id hzID top bottom ORCDRC   hue value chroma soil_color
 ISRIC:NG0017    1   0     18   18.4 7.5YR     3      2  #564436FF
 ISRIC:NG0017    2  18     36    4.4 7.5YR     4      4  #7D593AFF
 ISRIC:NG0017    3  36     65    3.6 2.5YR     5      6  #A96B4FFF
 ISRIC:NG0017    4  65     87    3.6   5YR     5      8  #AF6932FF
 ISRIC:NG0017    5  87    127    3.2   5YR     5      4  #997259FF
 ISRIC:NG0017    6 127    181    1.2  10YR     7      3  #C4AC8CFF

----- Sites (1 / 1 rows  |  2 / 2 columns) -----
           id FAO1988
 ISRIC:NG0017     LXp

Spatial Data:
    min max
lon 3.9 3.9
lat 7.5 7.5
CRS:  +proj=longlat +datum=WGS84 +no_defs> ## Not run: 
> ##D plotKML(prof1, var.name="ORCDRC", color.name="soil_color")
> ## End(Not run)
> 
> ## -------------- STIDF --------- ##
> library(sp)
> library(spacetime)
> ## daily temperatures for Croatia:
> data(HRtemp08)
> ## format the time column:
> HRtemp08$ctime <- as.POSIXct(HRtemp08$DATE, format="%Y-%m-%dT%H:%M:%SZ")
Error in .POSIXct(unclass(x) * 86400, tz = tz, ...) : 
  unused argument (format = "%Y-%m-%dT%H:%M:%SZ")
Calls: as.POSIXct -> as.POSIXct.Date
Execution halted