1

I am trying to use the package "rWBclimate", but nothing works and I keep getting the same error message.

Even when I try running code from the vignette (see code below) I get the same error

(https://cran.r-project.org/web/packages/rWBclimate/vignettes/rWBclimate.pdf).

I have tried several functions and I have fiddled around with the UTF-settings, I have also updated R and all packages to the latest versions...

 library(rWBclimate)

usa.dat <- get_model_temp("USA", "mavg", 2080, 2100)
usa.dat.bcc <- usa.dat[usa.dat$gcm == "bccr_bcm2_0", ]
usa.dat.had <- usa.dat[usa.dat$gcm == "ukmo_hadcm3", ]
usa.dat.bcc$ID <- paste(usa.dat.bcc$scenario, usa.dat.bcc$gcm, sep = "-")
usa.dat.had$ID <- paste(usa.dat.had$scenario, usa.dat.had$gcm, sep = "-")

plot.df <- rbind(usa.dat.bcc, usa.dat.had)
ggplot(plot.df, aes(x = as.factor(month), y = data, group = ID, colour = 
gcm, linetype = scenario)) + geom_point() + geom_path() + ylab("Average 
temperature in degrees C \n between
xlab("Month") + theme_bw()

Error = "No encoding supplied: defaulting to UTF-8. Error in rep(locator, dim(data_out)[1]) : invalid 'times' argument"

Any suggestions?

Thank you

Dr. Flow
  • 456
  • 5
  • 19

1 Answers1

1

The encoding is not the problem here, that is not an error message. When running vignette this is what pops up for me:

No encoding supplied: defaulting to UTF-8. Error in rep(locator, dim(data_out)[1]) : invalid 'times' argument

The first bit is FYI - R is telling you it defaults to UTF-8.

Check the description file in the package of for example tidyverse, ggplot, caret. You will observe that there is a line reading: Encoding: UTF-8.

In the description file of the package rWBclimate the encoding is missing which I reckon is prompting R's message.

The second bit is the error and I suspect the issue is with the package itself as a quick glance shows some of the functions are not visible to R, ie. check_ISO_codes() returns an error: could not find function "check_ISO_code". I am not entirely sure if the code is even maintained anymore, there were some questions about its status: https://github.com/ropensci/rWBclimate/issues/35

If I understand correctly the maintenance was shifted but I am not sure if the package has since been updated in any way.

In any case, hope you get to the bottom of this!

Zophai
  • 104
  • 9
  • Thank you for your answer. I posted a question on Github, and hopefully, they will look into it. I guess it is not being maintained properly..https://github.com/ropensci/rWBclimate/issues/37 – Dr. Flow Aug 09 '19 at 13:19