I'm having students walk through sections of the Hadley Wickham's ggplot2: Elegant Graphics for Data Analysis, and the first code snippet from section 7.2.1:
oz_states <- ozmaps::ozmap_states %>% filter(NAME != "Other Territories")
oz_votes <- rmapshaper::ms_simplify(ozmaps::abs_ced)
#> Registered S3 method overwritten by 'geojsonlint':
#> method from
#> print.location dplyr
produces the following error on rstudio.cloud:
Error in context_eval(join(src), private$context, serialize) :
Error in V8 context: ReferenceError: Uint8ClampedArray is not defined
at :1:5492
at FlatQueue.ids (:1:3995)
at Object. (:1:4109)
at o (:1:265)
at :1:316
at Object.internal.getBoundsSearchFunction (:1:586891)
at Object.internal.groupPolygonRings (:1:563644)
at GeoJSON.exportPolygonGeom (:1:739932)
at :1:736355
at Array.reduce (native)
One student also got the following warning on trying to load the rmapshaper
package mentioned in the snippet:
Warning: v8 Engine is version 3.14.5.9 but version >=6 is required for full functionality. Some rmapshaper functions, notably ms_clip() and ms_erase(), may not work. See GitHub - jeroen/V8: Embedded JavaScript Engine for R for help installing a modern version of v8 on your operating system.
Could these be related issues?
Update: One student found a workaround by using
oz_votes <- ozmaps::abs_ced
instead, but I'm not sure what accounts for it working.