geocompx/geocompr

Update binder

Robinlovelace opened this issue ยท 7 comments

Thanks to @yuvipanda for https://github.com/yuvipanda/rstudio-binder-template I'm trying a new Binder set-up with, see changes here (apologies for just copy pasting at this stage, will give full credit if we keep this Yuvi): https://github.com/Robinlovelace/geocompr/commit/13b97172cb93be8dae8ecaf432a5b8cc8fc70700

  • Test it works
  • Add more packages
  • Test full reproducibility by building the entire book in Binder

The new set-up has several advantages, not least using more up-to-date R version and being faster to load. One question: do the 'daily' releases of RStudio work with this?

Happy to report that the first task in this issue can be checked โœ”๏ธ and it loads in a fraction of the time of the previous one. Repro: click here https://mybinder.org/v2/gh/robinlovelace/geocompr/main?urlpath=rstudio and you should see something like this.

image

Update: with the latest version we're getting close. Fails on c. 2 with the following:

image

Message:

Quitting from lines 694-695 (02-spatial-data.Rmd) 
Error: $ operator is invalid for atomic vectors
In addition: Warning messages:
1: plotting the first 9 out of 10 attributes; use max.plot = 10 to plot all 
2: In st_centroid.sf(world_proj, of_largest_polygon = TRUE) :
  st_centroid assumes attributes are constant over geometries of x
3: In st_centroid.sf(indchi) :
  st_centroid assumes attributes are constant over geometries of x

Execution halted
Error in Rscript_render(f, render_args, render_meta, add1, add2) : 
  Failed to compile 02-spatial-data.Rmd

Not sure what's causing that but should be an easy fix.

I believe this is due to the new changes in stars->terra conversion that impact tmap. I think it should be fixed soon in dev stars -- r-spatial/stars#484 (comment). To be sure -- I plan to test if the problem is still there with dev versions of stars and terra....

Makes sense, hoping this will be fixed upstream ๐Ÿคž

I think it's fixed on dev stars, this is the version on Binder currently:

> packageVersion("stars")
[1] โ€˜0.5.4โ€™

Source: https://mybinder.org/v2/gh/robinlovelace/geocompr/main?urlpath=rstudio

Yep -- I can confirm -- this issue does not exist for the current dev version of terra and stars.

Happy to report that, other than a few minor issues in Chapter 5, related to 'values' not being set, the book is now fully reproducible in Binder ๐ŸŽ‰

image