# NOT RUN {
library(rgee)
ee_reattach() # reattach ee as a reserved word
ee_Initialize()
# Earth Engine List
ee_SimpleList <- ee$List$sequence(0, 12)
ee_NewList <- ee_SimpleList$map(
ee_pyfunc(
function(x) {
ee$Number(x)$add(x)
}
)
)
ee_NewList$getInfo()
# Earth Engine ImageCollection
constant1 <- ee$Image(1)
constant2 <- ee$Image(2)
ee_ic <- ee$ImageCollection(c(constant2, constant1))
ee_newic <- ee_ic$map(
ee_pyfunc(
function(x) ee$Image(x)$add(x)
)
)
ee_newic$mean()$getInfo()$type
# }
Run the code above in your browser using DataLab