Ops functions for stars objects, including comparison, product and divide, add, subtract

# S3 method for stars
Ops(e1, e2)

# S3 method for stars
Math(x, ...)

# S3 method for stars_proxy
Ops(e1, e2)

# S3 method for 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

Value

object of class stars

Examples

tif = system.file("tif/L7_ETMs.tif", package = "stars") x = read_stars(tif) x * x
#> stars object with 3 dimensions and 1 attribute #> attribute(s): #> L7_ETMs.tif #> Min. : 1 #> 1st Qu.: 2916 #> Median : 4761 #> Mean : 5512 #> 3rd Qu.: 7396 #> Max. :65025 #> dimension(s): #> from to offset delta refsys point values #> x 1 349 288776 28.5 PROJCS["UTM Zone 25, Sout... FALSE NULL [x] #> y 1 352 9120761 -28.5 PROJCS["UTM Zone 25, Sout... FALSE NULL [y] #> band 1 6 NA NA NA NA NULL
x / x
#> stars object with 3 dimensions and 1 attribute #> attribute(s): #> L7_ETMs.tif #> Min. :1 #> 1st Qu.:1 #> Median :1 #> Mean :1 #> 3rd Qu.:1 #> Max. :1 #> dimension(s): #> from to offset delta refsys point values #> x 1 349 288776 28.5 PROJCS["UTM Zone 25, Sout... FALSE NULL [x] #> y 1 352 9120761 -28.5 PROJCS["UTM Zone 25, Sout... FALSE NULL [y] #> band 1 6 NA NA NA NA NULL
x + x
#> stars object with 3 dimensions and 1 attribute #> attribute(s): #> L7_ETMs.tif #> Min. : 2.0 #> 1st Qu.:108.0 #> Median :138.0 #> Mean :137.8 #> 3rd Qu.:172.0 #> Max. :510.0 #> dimension(s): #> from to offset delta refsys point values #> x 1 349 288776 28.5 PROJCS["UTM Zone 25, Sout... FALSE NULL [x] #> y 1 352 9120761 -28.5 PROJCS["UTM Zone 25, Sout... FALSE NULL [y] #> band 1 6 NA NA NA NA NULL
x + 10
#> stars object with 3 dimensions and 1 attribute #> attribute(s): #> L7_ETMs.tif #> Min. : 11.00 #> 1st Qu.: 64.00 #> Median : 79.00 #> Mean : 78.91 #> 3rd Qu.: 96.00 #> Max. :265.00 #> dimension(s): #> from to offset delta refsys point values #> x 1 349 288776 28.5 PROJCS["UTM Zone 25, Sout... FALSE NULL [x] #> y 1 352 9120761 -28.5 PROJCS["UTM Zone 25, Sout... FALSE NULL [y] #> band 1 6 NA NA NA NA NULL
all.equal(x * 10, 10 * x)
#> [1] TRUE
tif = system.file("tif/L7_ETMs.tif", package = "stars") x = read_stars(tif) a = sqrt(x) b = log(x, base = 10)