I'm trying to convert this if/else function from JS (GEE) to rgee :
if ((typeof band) === 'string')
obviously, the "typeof" does not work in rgee, so I tried to find an alternative. I came up with the following code :
if (ee$Algorithms$ObjectType(band) == 'String')
The problem is that in that case, ee$Algorithms$ObjectType will not give me the object type of band, but gives EarthEngine Object: String
For example, if I try ee$Algorithms$ObjectType(ee$Number(2)), it results in : EarthEngine Object: String, while the good answer is "Integer". I can get the true information using ee$Algorithms$ObjectType(ee$Number(2))$getInfo(), but this is not applicable to script because it is client-sided.
Do you have any ideas ? Thanks a lot !
I tried to convert
if ((typeof band) === 'string')
to
if (ee$Algorithms$ObjectType(band) == 'String')
but it does not work