Closed mathiasweidinger closed 3 years ago
Hi @mathiasweidinger,
Thanks for checking things out! I suspect you need to reinstall the most up to date version,
remotes::install_github("mikejohnson51/climateR", force = TRUE)
and that should allow you get a result like this:
library(AOI)
library(climateR)
library(raster)
#> Loading required package: sp
kenya = aoi_get(country = "Kenya")
tc = getTerraClim(kenya, param = "prcp", startDate = "2018-01-01")
raster::plot(tc$terraclim_prcp)
Created on 2021-04-21 by the reprex package (v1.0.0)
Hope it helps!
Mike
Thanks @mikejohnson51 for the swift reply.
I just reinstalled and also made sure to load nothing beyond the basic working example. Unfortunately, the issue persists. Any other ideas what might cause this?
cheers
Did you restart your R session after reinstalling? 🤞 that works, otherwise, could you post your package info and a small reprex (like above) and I will dive in to it!
I restarted both my R session and my computer...still the same issue. Weirdly enough I replicated the exact same thing on the RStudio cloud and it worked fine - must be my system.
Here is the reprex including the package info in the toggle towards the end.
library(climateR)
library(AOI)
library(sp)
library(raster)
kenya = aoi_get(country = "Kenya")
tc = getTerraClim(kenya, param = "prcp", startDate = "2018-01-01")
#> Error in var[[i]] * scale_factor: non-numeric argument to binary operator
Created on 2021-04-21 by the reprex package (v2.0.0)
I really appreciate your time and help - thanks a lot!
Hi @mathiasweidinger looking at that output I don't see anything off. That was an error that I thought to be handled a few commits back ... The last step might be to just delete the current install of climateR (e.g. remove.packages("climateR")
and try to refresh it. I am sorry this is giving you a challenge and hope its worth it in the end!
Hey @mikejohnson51, I'm not sure what exactly caused the issue in the end but after a bit more tinkering I removed all non-base packages and now it works. Thanks for your help and have a good one!
Just got started with AOI and climateR. I tried to replicate the global data example from the climateR readme:
The first line worked, but the second one gave me the following error.
I'm uncertain to what operator it is referring...can you help me to resolve this?
(I run R version 4.0.4 (2021-02-15) on Win10)
Thanks in advance!