The following JS equivalent code is working in the gee playground, but not in rgee.
This should calculate the sum of 1:5.
lst <- ee$List$sequence(1,5,1)
runsum = lst$iterate(function(item,sum) {
item = ee$Number(item)
sum = ee$Number(sum)
return(sum$add(item))
},0)
The error I receive is:
Error in py_call_impl(callable, dots$args, dots$keywords) :
RuntimeError: Evaluation error: argument "item" is missing, with no default.
What is the right syntax for rgee?