allogamous / EnvRtype

Provide tools for collecting environmental data from GIS-based platforms,enabling environmental characterization studies, providing environmental relatedness kinships and kernels for genomic prediction of reaction norms
25 stars 20 forks source link

get_weather error #10

Open andreicpnunes opened 3 years ago

andreicpnunes commented 3 years ago

Hi guys,

Congratulations for the great job of Envrtype. Very useful!!

I'm testing the package. Last week "get_wether" worked well, but now I have the following error: Error: Unprocessable Entity (HTTP 422)

I would be glad to have your help.

env.data = get_weather(env.id = 'NAIROBI',lat = -1.367,lon = 36.834,start.day = '2015-03-01',end.day ='2015-04-01', country = 'KEN')


ATTENTION: This function requires internet access


Error: Unprocessable Entity (HTTP 422)

rdcoletta commented 3 years ago

I was having the same problem, but it worked again after re-installing the package:

library(devtools)
devtools::install_github("ropensci/nasapower",force = TRUE) # aug 2021
devtools::install_github('allogamous/EnvRtype',force=TRUE) # current version:  1.0.0 (May 2021)
require(EnvRtype)

My guess is that one of the dependencies got updated and created the issue.

adamhsparks commented 3 years ago

I've created a pull request that should help with this.

The POWER team updated the API, so any version prior to nasapower v4.0.0 won't work. The fix from @rdcoletta updates the locally installed version of nasapower using GitHub, but the CRAN version is now 4.0.0 and supports the new version of the POWER API.