1

I want to transform this gee line

var reclassified=ee.Image(0).where(classifiedData.eq(7).or(classifiedData.eq(13))//.or(classifiedData.eq(10)), 1).rename('water').clip(studyArea);

to rgee as follows

 reclassified<-ee$Image(0)$where(classifiedData$eq(13)|(classifiedData$eq(7)),1)$rename('water')$clip(marigat_plains)

But I get an error :

operations are possible only for numeric, logical or complex types

1 Answers1

0

Have you tried with :

reclassified<-ee$Image(0)$where(classifiedData$eq(13)$Or(classifiedData$eq(7)),1)$rename('water')$clip(marigat_plains)

or your similar script

reclassified<-ee$Image(0)$where(classifiedData$eq(13)$Or(classifiedData$eq(7)),1)$rename('water')$clip(marigat_plains)
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
cven
  • 11
  • 2
  • Remember that Stack Overflow isn't just intended to solve the immediate problem, but also to help future readers find solutions to similar problems, which requires understanding the underlying code. This is especially important for members of our community who are beginners, and not familiar with the syntax. Given that, **can you [edit] your answer to include an explanation of what you're doing** and why you believe it is the best approach? – Jeremy Caney Aug 19 '22 at 00:37