Ops functions for stars objects, including comparison, product and divide, add, subtract
## S3 method for class 'stars'Ops(e1, e2)## S3 method for class 'stars'Math(x,...)## S3 method for class 'stars_proxy'Ops(e1, e2)## S3 method for class 'stars_proxy'Math(x,...)
Arguments
e1: object of class stars
e2: object of class stars
x: object of class stars
...: parameters passed on to the Math functions
Returns
object of class stars
Details
if e1 or e2 is is a numeric vector, or e2
has less or smaller dimensions than e1, then e2 is recycled such that it fits e1, using usual R array recycling rules. The user needs to make sure this is sensible; it may be needed to use aperm
to permutate dimensions first.
Examples
tif = system.file("tif/L7_ETMs.tif", package ="stars")x = read_stars(tif)x * x
x / x
x + x
x +10all.equal(x *10,10* x)tif = system.file("tif/L7_ETMs.tif", package ="stars")x = read_stars(tif)a = sqrt(x)b = log(x, base =10)