3

I am trying to run the code (end of post) from this blog (world map of where R package is being downloaded from)

Everything is fine, except when I try to execute

wm

I get

> wm
Error in grid.Call.graphics(C_polygon, x$x, x$y, index) : 
  invalid color name 'blackcat'

I am expecting this instead,

enter image description here

How to troubleshoot?

install.packages(devtools)
library(devtools)
install_github("talgalili/installr", username="talgalili")
library(installr)
RStudio_CRAN_data_folder <- download_RStudio_CRAN_data(START = '2013-06-10',
                                                       END = '2013-06-17')
my_RStudio_CRAN_data <- read_RStudio_CRAN_data(RStudio_CRAN_data_folder)
wm <- pkgDNLs_worldmapcolor(pkg_name="timeROC",
                            dataset = my_RStudio_CRAN_data)
wm
Artie Ladie
  • 521
  • 4
  • 14
  • I dont know whats going on with `blackcat`, but if you look at the code of `pkgDNLs_worldmapcolor` you can see it is hard-coded. So you can either copy the function and tweak that, or else use an idea from [here](https://stackoverflow.com/questions/48209025/change-the-color-of-a-ggplot-geom-a-posteriori-after-having-specified-another-c) and do `wm$layers[[1]]$aes_params$colour <- "black"` . then it should plot – user20650 Jul 08 '18 at 21:57
  • @user20650 Thank you so much. Adding `wm$layers[[1]]$aes_params$colour <- "black"` works – Artie Ladie Jul 08 '18 at 22:05
  • 1
    you're welcome - Its probably worth asking how/what/why the funky cat name at the github page of installr : https://github.com/talgalili/installr/issues – user20650 Jul 08 '18 at 22:08
  • 2
    @user20650 Good idea, just added an issue – Artie Ladie Jul 08 '18 at 22:12
  • 1
    good: you can see at https://github.com/talgalili/installr/commit/c6911f3cc7c714f4416b37befb7323d3e63bdb2e#diff-333d54a4a1cdfd1d4994c2dfedf15e0aL464 when it was changed – user20650 Jul 08 '18 at 22:13

0 Answers0