library(rgee)
rgee::ee_Initialize() # it will work now!
createTimeBand <-function(img) {
year <- ee$Date(img$get('system:time_start'))$get('year')$subtract(1991L)
ee$Image(year)$byte()$addBands(img)
}
img <- ee$ImageCollection('ECMWF/ERA5_LAND/HOURLY')$
filterBounds(ee$Geometry$Point(117, 40))$
select('total_precipitation')$
first()
vizParams <- list(
bands = 'total_precipitation',
min = 0,
max = 0.0000005,
gamma = 0.01
)
Map$setCenter(117, 40, 10)
# You can see it
m1 <- Map$addLayer(img, vizParams, 'first')
m1