Closed Heed725 closed 1 year ago
Hello guys, @mikejohnson51 and @raspodia Hopefully you're doing well,I had a question on climateR..... there's been an update everything have been going well on this code except one part on masking
library(terra) library(rasterVis) library(sf) library(climateR) library(RColorBrewer) library(raster)
KGZ <- st_read("c:/Dodoma.shp") plot(KGZ)
test_data <- getTerraClim( KGZ, varname = "ppt", startDate = "2010-01-01", endDate = "2019-12-31" ) index = rep(1:10, each = 12)
annualmax = app(rast(test_data$ppt), fun = "mean") |> mask(vect("c:/Dodoma.shp"))
levelplot(annualmax, par.settings = rasterTheme(region = brewer.pal('blues', n = 9)), names.attr = as.character(c(2010:2019)))
The annual max part is giving me error
Error: [mask] SpatRaster has no values
Is there a solution for that
See #58
Hello guys, @mikejohnson51 and @raspodia Hopefully you're doing well,I had a question on climateR..... there's been an update everything have been going well on this code except one part on masking
library(terra) library(rasterVis) library(sf) library(climateR) library(RColorBrewer) library(raster)
Get 6 years of tmax data for New York
KGZ <- st_read("c:/Dodoma.shp") plot(KGZ)
test_data <- getTerraClim( KGZ, varname = "ppt", startDate = "2010-01-01", endDate = "2019-12-31" ) index = rep(1:10, each = 12)
annualmax = app(rast(test_data$ppt), fun = "mean") |> mask(vect("c:/Dodoma.shp"))
Plot
levelplot(annualmax, par.settings = rasterTheme(region = brewer.pal('blues', n = 9)), names.attr = as.character(c(2010:2019)))
The annual max part is giving me error
Error: [mask] SpatRaster has no values
Is there a solution for that