Giter VIP home page Giter VIP logo

Comments (2)

atsyplenkov avatar atsyplenkov commented on May 31, 2024 1

Any update on this?
I have the same error while running getTerraClim on my Windows machine.

library(AOI)
library(climateR)
library(sf)
#> Linking to GEOS 3.9.1, GDAL 3.2.1, PROJ 7.2.1; sf_use_s2() is TRUE
library(raster)
library(rasterVis)

kenya = aoi_get(country = "Kenya")
tc = getTerraClim(kenya, param = "prcp", startDate = "2018-01-01")
#> Spherical geometry (s2) switched off
#> Spherical geometry (s2) switched on
#> Error in var[[i]] * scale_factor : 
  non-numeric argument to binary operator

sessionInfo()

R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=Russian_Russia.1251  LC_CTYPE=Russian_Russia.1251   
[3] LC_MONETARY=Russian_Russia.1251 LC_NUMERIC=C                   
[5] LC_TIME=Russian_Russia.1251    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] reprex_2.0.1     rasterVis_0.51.2 lattice_0.20-45  raster_3.5-15   
[5] sp_1.4-6         sf_1.0-5         climateR_0.1.0   AOI_0.2.0.9000  

from climater.

mikejohnson51 avatar mikejohnson51 commented on May 31, 2024 1

Hi @joeyblumberg and @atsyplenkov,

Thank you for this issue and sorry for the long delay on this. The package has been completely re-written to supply greater flexibility, more datasets, and easier use. In this example, the issues in PRISM and Daymet have been resolved:

library(AOI)
library(climateR)
#> Using GDAL version 3.6.0 which was retracted because it cannot write large GPKG files
library(terra)
#> terra 1.7.8

# Used tmin instead of ppt to see values, both work though
prism_tmin_1mo <- getPRISM(AOI = aoi_get(state = "AZ"),
                           varname = "tmin",
                           startDate = "1990-01-01",
                           endDate = "1990-02-01")


plot(prism_tmin_1mo$tmin$`tmin_1990-01-01`)

daymet_prcp_1day <- getDaymet(AOI = aoi_get(state = "AZ"),
                              varname = "prcp",
                              startDate = "1990-01-01")

plot(daymet_prcp_1day$prcp_total)

kenya = aoi_get(country = "Kenya")
tc = getTerraClim(kenya, varname = "ppt", startDate = "2018-01-01")

plot(tc$ppt_total)

Created on 2023-02-15 by the reprex package (v2.0.1)

I hope the package rewrite proves useful to you if you are still using it and pursuing simular research/data questions.

Mike

from climater.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.