Skip to content

Error messages in C5 #695

@Robinlovelace

Description

@Robinlovelace

I'm seeing the following errors in Chapter 5:

> elev = rast(system.file("raster/elev.tif", package = "spData"))
> elev_2 = extend(elev, c(1, 2))
> 
> # Chunk 52: extend-example
> source("https://github.com/Robinlovelace/geocompr/raw/main/code/05-extend-example.R", print.eval = TRUE)
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in (function (x)  : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in (function (x)  : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in (function (x)  : attempt to apply non-function
> 
> # Chunk 53: 05-geometry-operations-37
> elev_3 = elev + elev_2
Error: [+] extents do not match
> 
> # Chunk 54: 05-geometry-operations-38
> elev_4 = extend(elev, elev_2)
> 
> # Chunk 55: 05-geometry-operations-39
> origin(elev_4)
[1] 0 0
> 
> # Chunk 56
> # change the origin
> origin(elev_4) = c(0.25, 0.25)
> elev_poly = st_as_sf(as.polygons(elev, dissolve = FALSE))
> elev4_poly = st_as_sf(as.polygons(elev_4, dissolve = FALSE))
> tm_shape(elev4_poly) +
+   tm_grid() +
+   tm_polygons(col = "elev") + 
+   tm_shape(elev_poly) +
+   tm_polygons(col = "elev") +
+   tm_layout(frame = FALSE, legend.show = FALSE,
+             inner.margins = c(0.1, 0.12, 0, 0))
Error: The shape elev4_poly only contains empty units.
> elev4_poly$geometry

With up-to-date versions of packages, session info below.

``` devtools::session_info() ─ Session info ─────────────────────────────────────────────────────────────────────────────────────────────────────────────── setting value version R version 4.1.2 (2021-11-01) os Ubuntu 20.04.3 LTS system x86_64, linux-gnu ui RStudio language en_GB:en collate en_GB.UTF-8 ctype en_GB.UTF-8 tz Europe/London date 2021-12-17 rstudio 2022.01.0-daily+300.pro1 Prairie Trillium (server) pandoc 2.16.2 @ /usr/lib/rstudio-server/bin/quarto/bin/ (via rmarkdown)

─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
package * version date (UTC) lib source
abind 1.4-5 2016-07-21 [2] CRAN (R 4.0.2)
assertthat 0.2.1 2019-03-21 [3] CRAN (R 4.0.0)
base64enc 0.1-3 2015-07-28 [2] CRAN (R 4.0.2)
bookdown 0.24 2021-09-02 [2] CRAN (R 4.1.1)
cachem 1.0.6 2021-08-19 [2] CRAN (R 4.1.1)
callr 3.7.0 2021-04-20 [3] CRAN (R 4.0.5)
class 7.3-19 2021-05-03 [4] CRAN (R 4.0.5)
classInt 0.4-3 2020-04-07 [2] CRAN (R 4.0.2)
cli 3.1.0 2021-10-27 [2] CRAN (R 4.1.1)
codetools 0.2-18 2020-11-04 [4] CRAN (R 4.0.3)
colorspace 2.0-2 2021-06-24 [2] CRAN (R 4.1.1)
crayon 1.4.2 2021-10-29 [2] CRAN (R 4.1.1)
crosstalk 1.2.0 2021-11-04 [2] CRAN (R 4.1.2)
crul 1.2.0 2021-11-22 [2] CRAN (R 4.1.2)
curl 4.3.2 2021-06-23 [2] CRAN (R 4.1.1)
DBI 1.1.1 2021-01-15 [2] CRAN (R 4.0.3)
desc 1.4.0 2021-09-28 [2] CRAN (R 4.1.1)
devtools 2.4.3 2021-11-30 [2] CRAN (R 4.1.2)
dichromat 2.0-0 2013-01-24 [2] CRAN (R 4.0.2)
digest 0.6.29 2021-12-01 [2] CRAN (R 4.1.2)
dplyr * 1.0.7 2021-06-18 [2] CRAN (R 4.1.1)
e1071 1.7-9 2021-09-16 [2] CRAN (R 4.1.1)
ellipsis 0.3.2 2021-04-29 [2] CRAN (R 4.1.1)
evaluate 0.14 2019-05-28 [3] CRAN (R 4.0.0)
fansi 0.5.0 2021-05-25 [2] CRAN (R 4.1.1)
fastmap 1.1.0 2021-01-25 [2] CRAN (R 4.1.1)
foreign 0.8-81 2020-12-22 [4] CRAN (R 4.0.3)
fs 1.5.2 2021-12-08 [2] CRAN (R 4.1.2)
generics 0.1.1 2021-10-25 [2] CRAN (R 4.1.1)
geojson 0.3.4 2020-06-23 [2] CRAN (R 4.0.2)
geojsonio 0.9.4 2021-01-13 [2] CRAN (R 4.0.3)
geojsonlint 0.4.0 2020-02-13 [2] CRAN (R 4.0.2)
geojsonsf 2.0.1 2020-10-02 [3] CRAN (R 4.0.2)
geosphere 1.5-14 2021-10-13 [2] CRAN (R 4.1.1)
glue 1.6.0 2021-12-17 [1] CRAN (R 4.1.2)
highr 0.9 2021-04-16 [3] CRAN (R 4.0.5)
htmltools 0.5.2 2021-08-25 [2] CRAN (R 4.1.1)
htmlwidgets 1.5.4 2021-09-08 [2] CRAN (R 4.1.1)
httpcode 0.3.0 2020-04-10 [2] CRAN (R 4.0.2)
httr 1.4.2 2020-07-20 [2] CRAN (R 4.0.2)
jqr 1.2.2 2021-11-08 [2] CRAN (R 4.1.2)
jsonlite 1.7.2 2020-12-09 [2] CRAN (R 4.1.1)
jsonvalidate 1.3.2 2021-11-03 [2] CRAN (R 4.1.1)
kableExtra 1.3.4 2021-02-20 [2] CRAN (R 4.0.4)
KernSmooth 2.23-20 2021-05-03 [4] CRAN (R 4.0.5)
knitr 1.37 2021-12-16 [1] CRAN (R 4.1.2)
lattice 0.20-45 2021-09-22 [2] CRAN (R 4.1.1)
lazyeval 0.2.2 2019-03-15 [3] CRAN (R 4.0.0)
leafem 0.1.6 2021-05-24 [2] CRAN (R 4.0.4)
leaflet 2.0.4.1 2021-01-07 [2] CRAN (R 4.0.3)
leafsync 0.1.0 2019-03-05 [2] CRAN (R 4.0.2)
lifecycle 1.0.1 2021-09-24 [2] CRAN (R 4.1.1)
lwgeom 0.2-8 2021-10-06 [2] CRAN (R 4.1.1)
magrittr 2.0.1 2020-11-17 [2] CRAN (R 4.1.1)
maptools 1.1-2 2021-09-07 [2] CRAN (R 4.1.1)
memoise 2.0.1 2021-11-26 [3] CRAN (R 4.1.2)
munsell 0.5.0 2018-06-12 [2] CRAN (R 4.0.2)
pillar 1.6.4 2021-10-18 [2] CRAN (R 4.1.1)
pkgbuild 1.3.0 2021-12-09 [3] CRAN (R 4.1.2)
pkgconfig 2.0.3 2019-09-22 [2] CRAN (R 4.1.1)
pkgload 1.2.4 2021-11-30 [3] CRAN (R 4.1.2)
png 0.1-7 2013-12-03 [2] CRAN (R 4.0.2)
prettyunits 1.1.1 2020-01-24 [3] CRAN (R 4.0.0)
processx 3.5.2 2021-04-30 [2] CRAN (R 4.1.1)
proxy 0.4-26 2021-06-07 [2] CRAN (R 4.0.4)
ps 1.6.0 2021-02-28 [2] CRAN (R 4.1.1)
purrr 0.3.4 2020-04-17 [2] CRAN (R 4.1.1)
R6 2.5.1 2021-08-19 [2] CRAN (R 4.1.1)
ragg 1.2.1 2021-12-06 [2] CRAN (R 4.1.2)
raster 3.5-9 2021-12-10 [2] CRAN (R 4.1.2)
RColorBrewer 1.1-2 2014-12-07 [2] CRAN (R 4.1.1)
Rcpp 1.0.7 2021-07-07 [2] CRAN (R 4.1.1)
remotes 2.4.2 2021-11-30 [1] CRAN (R 4.1.2)
rgdal 1.5-28 2021-12-15 [1] CRAN (R 4.1.2)
rgeos 0.5-9 2021-12-15 [1] CRAN (R 4.1.2)
rlang 0.4.12 2021-10-18 [2] CRAN (R 4.1.1)
rmapshaper 0.4.5 2021-05-26 [2] CRAN (R 4.0.4)
rmarkdown 2.11 2021-09-14 [2] CRAN (R 4.1.1)
rprojroot 2.0.2 2020-11-15 [3] CRAN (R 4.0.3)
rstudioapi 0.13 2020-11-12 [2] CRAN (R 4.1.1)
rvest 1.0.2 2021-10-16 [3] CRAN (R 4.1.1)
s2 1.0.7 2021-09-28 [2] CRAN (R 4.1.1)
scales 1.1.1 2020-05-11 [2] CRAN (R 4.1.1)
sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.1.2)
sf * 1.0-5 2021-12-17 [1] CRAN (R 4.1.2)
sp 1.4-6 2021-11-14 [2] CRAN (R 4.1.2)
spData * 2.0.1 2021-09-21 [2] Github (Nowosad/spData@9c942ba)
spDataLarge * 2.0.3 2021-12-17 [1] Github (Nowosad/spDataLarge@d1ef6d4)
stars 0.5-5 2021-12-17 [1] Github (r-spatial/stars@4292774)
stringi 1.7.6 2021-11-29 [2] CRAN (R 4.1.2)
stringr 1.4.0 2019-02-10 [2] CRAN (R 4.1.1)
svglite 2.0.0 2021-02-20 [3] CRAN (R 4.0.4)
systemfonts 1.0.3 2021-10-13 [3] CRAN (R 4.1.1)
terra * 1.5-2 2021-12-17 [1] Github (rspatial/terra@a0a29a6)
testthat 3.1.1 2021-12-03 [3] CRAN (R 4.1.2)
textshaping 0.3.6 2021-10-13 [2] CRAN (R 4.1.1)
tibble 3.1.6 2021-11-07 [2] CRAN (R 4.1.2)
tidyr 1.1.4 2021-09-27 [2] CRAN (R 4.1.1)
tidyselect 1.1.1 2021-04-30 [2] CRAN (R 4.1.1)
tmap * 3.3-3 2021-12-17 [1] Github (mtennekes/tmap@1204aaa)
tmaptools 3.1-1 2021-01-19 [2] CRAN (R 4.0.3)
units 0.7-2 2021-06-08 [2] CRAN (R 4.0.4)
usethis 2.1.5 2021-12-09 [1] CRAN (R 4.1.2)
utf8 1.2.2 2021-07-24 [2] CRAN (R 4.1.0)
V8 3.6.0 2021-11-10 [2] CRAN (R 4.1.2)
vctrs 0.3.8 2021-04-29 [2] CRAN (R 4.1.1)
viridisLite 0.4.0 2021-04-13 [2] CRAN (R 4.0.4)
webshot 0.5.2 2019-11-22 [3] CRAN (R 4.0.0)
withr 2.4.3 2021-11-30 [2] CRAN (R 4.1.2)
wk 0.5.0 2021-07-13 [2] CRAN (R 4.1.0)
xfun 0.29 2021-12-14 [1] CRAN (R 4.1.2)
XML 3.99-0.8 2021-09-17 [2] CRAN (R 4.1.1)
xml2 1.3.3 2021-11-30 [3] CRAN (R 4.1.2)
yaml 2.2.1 2020-02-01 [2] CRAN (R 4.1.1)

[1] /home/robin/R/x86_64-pc-linux-gnu-library/4.1
[2] /usr/local/lib/R/site-library
[3] /usr/lib/R/site-library
[4] /usr/lib/R/library

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions